I am trying to use react-spring and I have a very simple animation for a component that should be moounted/unmounted on toggle.
const state = useContext(MyContext)
const transitions = useTransition(state.nav, null, {
from: { tranform: 'translate3d(-100%, 0, 0)' },
enter: { transform: 'translate3d(0, 0, 0)' },
leave: { tranform: 'translate3d(-100%, 0, 0)' },
})
return transitions.map((item, key, props) => (
<animated.div style={props} key={key}>
<Navigation items={items} />
</animated.div>
))
However when I run this in the browser I get this error:
Uncaught TypeError: Failed to set an indexed property on 'CSSStyleDeclaration': Index property setter is not supported.
Apart from using Context I can't see nothing wrong, when I look at other tutorial. Any help is appreciated thanks!