-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example sharing local state between components #76
Conversation
afc163
commented
Nov 5, 2019
- https://twitter.com/AntDesignUI/status/1189803756323405831
- https://codesandbox.io/s/antd-reproduction-template-knr9g
|
||
export default () => ( | ||
<div style={{ padding: 40 }}> | ||
useSWR can share state bettween components: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useSWR can share state bettween components: | |
useSWR can share state between components: |
fixed |
Thanks! This is an interesting use case which uses SWR for global state management (like Redux). But currently SWR revalidates itself constantly (e.g.: on focus / new component being added, etc.) and will be set to I think we can add an option to support this use case better (turn off revalidation completely). |
Yeah, it is a tricky usage and I am happy to show potential of swr in multiple ways. |
Although it can be supported with a |
Any chance to merge this? |
@afc163 can you delete yarn.lock? And I’ll merge it. 👍 Although we’ll keep improving the example in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!