Closed sagroone closed 1 year ago
Hey @sagroone!
Sadly, this is just how React works:
const counter$ = newAtom(0)
useProperty
hookuseProperty
hook re-renders the whole component starting from scratch which ultimately re-creates the atom from pt.1To fix this, you need to wrap the atom in useMemo
- const counter$ = useMemo(() => newAtom(0), []);
@raveclassic Thanks for help
Hi there! I'm trying to use your lib with react, but there are no reactions in the component Does need anything else for reaction?
And one more question, does this library work with React Native?
Sandbox link https://codesandbox.io/s/dreamy-benz-5utty9?file=/src/App.js