Skip to content

Fix TypeScript error#1377

Merged
justin808 merged 2 commits intoshakacode:masterfrom
mdesantis:patch-1
Jul 26, 2021
Merged

Fix TypeScript error#1377
justin808 merged 2 commits intoshakacode:masterfrom
mdesantis:patch-1

Conversation

@mdesantis
Copy link
Copy Markdown
Contributor

@mdesantis mdesantis commented Jul 11, 2021

It fixes the following Typescript error:

error TS2345: Argument of type '{ traceTurbolinks: true; turbo: boolean; }' is not assignable to parameter of type '{ traceTurbolinks: boolean; }'.
  Object literal may only specify known properties, and ''turbo'' does not exist in type '{ traceTurbolinks: boolean; }'.

That happens on this code:

ReactOnRails.setOptions({
  'traceTurbolinks': true,
  'turbo': true
})

Due to the fact that the options type is inferred by DEFAULT_OPTIONS.


This change is Reviewable

It fixes the following Typescript error:

```
error TS2345: Argument of type '{ traceTurbolinks: true; turbo: boolean; }' is not assignable to parameter of type '{ traceTurbolinks: boolean; }'.
  Object literal may only specify known properties, and ''turbo'' does not exist in type '{ traceTurbolinks: boolean; }'.
```

That happens on this code:

```ts
ReactOnRails.setOptions({
  'traceTurbolinks': true,
  'turbo': true
})
```

Due to the fact that the `options` type is inferred by `DEFAULT_OPTIONS`.
@justin808
Copy link
Copy Markdown
Member

LGTM

@justin808
Copy link
Copy Markdown
Member

Will merge once it passes CI.

@justin808 justin808 merged commit c1ccef8 into shakacode:master Jul 26, 2021
@justin808
Copy link
Copy Markdown
Member

Thanks @mdesantis!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants