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
Typically the state would only be shared between buttons within the same component - components are meant to talk to each other using messages. Though you could accomplish this by using a shared variable between them (Arc<Mutex<u32>> or Rc<Cell<u32>>). I'll add this to the cookbook.
Looking for examples on how we would share state between different events:
Borrowing from your README.md Example.
I'd like to see an example where we render 2 buttons and they share the
clicks
state.Heres a React Example: of what I mean
https://codesandbox.io/s/isolated-vs-shared-q2ii5?file=/src/App.tsx
Mogwai code:
The text was updated successfully, but these errors were encountered: