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

Support React v16 #106

Open
realAlexBarge opened this issue Feb 9, 2018 · 7 comments
Open

Support React v16 #106

realAlexBarge opened this issue Feb 9, 2018 · 7 comments

Comments

@realAlexBarge
Copy link

Currently due to the fact that React 16 does not work when previous React versions are included winterfell does not work in React 16. The following error is thrown when trying to fill the form:

ReactBaseClasses.js:64 Uncaught TypeError: this.updater.enqueueCallback is not a function
at RadioOptionsInput../node_modules/winterfell/node_modules/react/lib/ReactBaseClasses.js.ReactComponent.setState (ReactBaseClasses.js:64)
at RadioOptionsInput.handleChange (radioOptionsInput.js:29)
at HTMLUnknownElement.callCallback (react-dom.development.js:542)
at Object.invokeGuardedCallbackDev (react-dom.development.js:581)
at Object.invokeGuardedCallback (react-dom.development.js:438)
at Object.invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:452)
at executeDispatch (react-dom.development.js:836)
at executeDispatchesInOrder (react-dom.development.js:858)
at executeDispatchesAndRelease (react-dom.development.js:956)
at executeDispatchesAndReleaseTopLevel (react-dom.development.js:967)
at Array.forEach ()
at forEachAccumulated (react-dom.development.js:935)
at processEventQueue (react-dom.development.js:1112)
at runEventQueueInBatch (react-dom.development.js:3607)
at handleTopLevel (react-dom.development.js:3616)
at handleTopLevelImpl (react-dom.development.js:3347)
at batchedUpdates (react-dom.development.js:11082)
at batchedUpdates (react-dom.development.js:2330)
at dispatchEvent (react-dom.development.js:3421)

Is there an existing workaround? Is support for React 16 planned?

@andrewhathaway
Copy link
Owner

Hi @perdox, I'll setup a copy and check for myself. I've been able to run it against Winterfell myself. Are you using the prebuilt version or bundling it yourself using the npm package?

@wispoz
Copy link

wispoz commented Apr 5, 2018

This issue exists when you add winterfell into cretate-react-app
steps:

  • create clean (create-react-app)
  • npm i winterfell
  • npm run start

@dsdkodi
Copy link

dsdkodi commented Apr 10, 2018

Hi,
any chance to get Winterfell to work with React 16?
Just tried to use it with a newly created React app and get the same error...
I used the same procedure as wispoz:

  • create clean (create-react-app)
  • npm i winterfell
  • npm run start

@FR0NK3NST33N
Copy link

FR0NK3NST33N commented Jun 6, 2018

@andrewhathaway After doing a little investigating on the error, it seems like the solution is to require react and react-dom as a peerDependency not a dependency in the winterfell package. After removing react and react-dom from the node_modules inside winterfell, this issue went away.

src for solution: enzymejs/enzyme#1199

Edit for clarification: This issue stems from a package having a react and react-dom version < 16 and the project you are importing into has versions >= 16. Dependency mismatch

@Pharserror
Copy link

👍 on this. Is there a PR?

@andrewhathaway
Copy link
Owner

@Pharserror Not currently, could you facilitate? :)

@qxzcode
Copy link

qxzcode commented Dec 1, 2018

I had this same issue just now. The npm package needs to be updated to match this GitHub repo. (The version number in package.json should probably be incremented? @andrewhathaway)

Until that happens, a workaround is to install Winterfell from GitHub instead of npm:

$ npm install andrewhathaway/Winterfell

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

7 participants