🐛 Object passed to style
prop gets mutated, which can lead to inconsistencies
#1211
Labels
style
prop gets mutated, which can lead to inconsistencies
#1211
Describe the bug
Because Orbit styleprops don't support all CSS properties, we sometimes have to pass an object to the
styles
property.It might be desireable to store the style object in a variable, to be able to reuse the styles across components:
However, doing so might lead to hard-to-understand bugs, as the object that is passed to the
style
prop seems to be directly mutated by Orbit, which makes sharing the object potentially dangerous:Steps to reproduce
See above.
Expected results
Orbit should not mutate objects passed as props directly, as those might be shared between components.
Reproducible demo
https://codesandbox.io/embed/orbit-transition-style-bug-g6u27z?fontsize=14&hidenavigation=1&module=%2FApp.tsx&theme=dark
The text was updated successfully, but these errors were encountered: