Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TypeScript error #1377

Merged
merged 2 commits into from
Jul 26, 2021
Merged

Fix TypeScript error #1377

merged 2 commits into from
Jul 26, 2021

Conversation

mdesantis
Copy link
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
Member

LGTM

@justin808
Copy link
Member

Will merge once it passes CI.

@justin808 justin808 merged commit c1ccef8 into shakacode:master Jul 26, 2021
@justin808
Copy link
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