You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure what I'm doing wrong but nothing seems to be reactive anymore. Reproduce
import'./App.css';import{observable}from'@legendapp/state';import{enableReactTracking}from'@legendapp/state/config/enableReactTracking';enableReactTracking({auto: true});constcount$=observable(0);functionApp(){constcount=count$.get();return(<><divclassName="card"><buttononClick={()=>count$.set(count+1)}>count is {count}</button><p>
Edit <code>src/App.tsx</code> and save to test HMR
</p></div><pclassName="read-the-docs">
Click on the Vite and React logos to learn more
</p></>);}exportdefaultApp;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm not sure what I'm doing wrong but nothing seems to be reactive anymore. Reproduce
Found the answers here
I wish it was indicated that the state outside the component will not be reactive/trigger a re-render.
Not super happy about wrapping every component in an observer function. Why this?
Beta Was this translation helpful? Give feedback.
All reactions