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

React Context API Unstable features and how to leverage it #1

Closed
lxsmnsyc opened this issue Nov 6, 2019 · 0 comments
Closed

React Context API Unstable features and how to leverage it #1

lxsmnsyc opened this issue Nov 6, 2019 · 0 comments

Comments

@lxsmnsyc
Copy link
Owner

lxsmnsyc commented Nov 6, 2019

Recently, I have just learned that users of the observed bits feature gets warned in dev mode by the React library.

This was confusing at first as there is no documentation for it, and it just came to my understanding when I have read issues regarding it.

facebook/react#14815
facebook/react#14729

Apparently, the feature was unstable, and could be removed in upcoming updates of React.

To leverage this unstable feature and to make this package stable, I decided to rewrite the package to not use the feature.

Benefits are:

  • No longer console warnings on development mode (which reduces the noise).
  • Fine-grained subscription to the model output, which gives much more reasonable re-render than the current one.
  • Removes the unstable parts of the API for safety.

Implementation-wise, the benefits are also:

  • The library is now possible to be rewritten in TypeScript.
  • The library is now portable in ReasonReact (through bindings or native implementation).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant