-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Default props can't be overridden by inline props #1123
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
Comments
Hi @tomdohnal the issue is because there is no prop with the name default. This works fine. if (toggle) {
setStyle({
transform: "translateX(0px)",
immediate: true
});
}
else {
setStyle({
transform: "translateX(200px)",
immediate: false
});
} |
I'm using the v9 (9.0.0.-rc3) version of the library which introduces the concept of |
Ohh alright, my bad. I forgot you mentioned the environment you were running on. But won't toggling the state of the default prop defeat the purpose of setting it as default? |
Yeah, you probably wouldn't use it like that in a real-life scenario :) |
🐛 Bug Report
(A clear and concise description of what the bug is.)
To Reproduce
default: { immediate: true }
in thesetStyle(...)
call.immediate: false
in thesetStyle(...)
call. It works as expected if we usedefault: { immediate: false }
and override the "default" props. However, I think the default props should be overridden by setting specific props in the function calls.See https://codesandbox.io/s/quirky-goodall-6z3og?file=/src/App.js
Expected behavior
The default props should be overridden by "inline" props.
Link to repro (highly encouraged)
https://codesandbox.io/s/quirky-goodall-6z3og?file=/src/App.js
Environment
react-spring
v9.0.0.-rc3react
v16.12The text was updated successfully, but these errors were encountered: