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

Enabled parameter throws error and does not work. #4633

Closed
Bodom78 opened this issue Jun 1, 2021 · 0 comments
Closed

Enabled parameter throws error and does not work. #4633

Bodom78 opened this issue Jun 1, 2021 · 0 comments
Labels

Comments

@Bodom78
Copy link

Bodom78 commented Jun 1, 2021

  • Swiper Version: 6.7.0 (c7327d4)
  • Platform/Target and Browser Versions: Any

What You Did

Added the enabled parameter to the Swiper React component.

Here is the basic react example with the enabled parameter set to false, console shows error and Swiper not disabled.

https://codesandbox.io/s/swiper-react-default-forked-ntim9?file=/src/App.js

Expected Behavior

I expected the Swiper to be disabled when setting enabled to false.

Actual Behavior

Has no effect on the Swiper and throws the following error:

Warning: Received `false` for a non-boolean attribute `enabled`. If you want to write it to the DOM, pass a string instead: enabled="false" or enabled={value.toString()}. If you used to conditionally omit it with enabled={condition && value}, pass enabled={condition ? value : undefined} instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant