Skip to content
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

feat(createGlobalState)!: Align API with React.useState #1021

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Jun 20, 2020

  1. feat(createGlobalState)!: Align API with React.useState

    This commit adds support for functional updates to align with the React.useState
    API. Type definitions are updated to match useState.
    
    This might break existing code that expects functions to be held in the global
    state, rather than applied as an update.
    
    This change may also cause new type errors.
    Nathan Spaeth committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    f905c53 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e90ff1f View commit details
    Browse the repository at this point in the history
  3. Use useFirstMountState instead of useLayoutEfect

    Makes the call synchronous to avoid race conditions, and works with SSR.
    See comment at:
    streamich#1060 (comment)
    Nathan Spaeth committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    5cb288d View commit details
    Browse the repository at this point in the history