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

Refactor withInjector away from the legacy API #686

Open
ScopeyNZ opened this issue Oct 14, 2018 · 0 comments
Open

Refactor withInjector away from the legacy API #686

ScopeyNZ opened this issue Oct 14, 2018 · 0 comments

Comments

@ScopeyNZ
Copy link
Contributor

ScopeyNZ commented Oct 14, 2018

Currently withInjector is using the context API that was included with React 15. In React 16 this API was deprecated and replaced in React 16.3 with the new context API:

New API: https://reactjs.org/docs/context.html
Legacy API: https://reactjs.org/docs/legacy-context.html

I see two options:

  • Refactor withInjector to be a more standard HOC that supplies some resolver function as a prop
  • Refactor withInjector to use the new Context API in React 16.3 (which means this issue will be reliant on the upgrade covered in Upgrade to React 16 and latest node.js version #648)

I ran a quick usage scan on our own modules - I can only see it used by admin (outside of other Injector library code) in FormBuilder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants