Sanity: Ensure compatibility with React v16.8

Created on 18 Mar 2019  Â·  7Comments  Â·  Source: sanity-io/sanity

Hooks are going to become a popular way doing things in the not-too-distant future. We should ensure that the Content Studio runs smoothly on React v16.8.

Also, do we want to re-write some of your logic to use hooks?

Enhancement Needs Discussion DX

Most helpful comment

This has a high priority from our side and hopefully a fix will be available by the end of this week or early next week. Thanks for your patience!

All 7 comments

I'm writing my plugins using Class components and would love to be able to use hooks. +1 from the plugin side!

I think we should definitively support hooks too. I think we should follow the React teams’ advice of not refactoring, but rather, use hooks when it makes sense in future components.

react-hot-loader seemed to be the problem last time we checked up on this.

Trying to created a plugin right now with hooks:

TypeError: Cannot read property 'expirationTime' of undefined which seems to be a known issue https://github.com/facebook/react/issues/14767#issuecomment-461118304 can we upgrade at least react-hot-loader to use hooks on the side of the plugins? quite sad not being able to code with hooks.

Screen Shot 2019-07-31 at 1 23 18 PM

This has a high priority from our side and hopefully a fix will be available by the end of this week or early next week. Thanks for your patience!

I just encountered this error trying to use hooks in an input component. Glad I found this issue though, so I didn't spend more time trying to figure this out.

Seems like react-hot-loader is locked to an older version ( https://github.com/sanity-io/sanity/blob/ef3c8c2549aeab830c68e26390ba006d2547823d/packages/%40sanity/server/package.json#L56), and it could be worth having an eye on https://github.com/gaearon/react-hot-loader/issues/1088

A fix has been released in v0.142.0 🎉

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robinpyon picture robinpyon  Â·  4Comments

bjoerge picture bjoerge  Â·  3Comments

davesag picture davesag  Â·  6Comments

mickeyreiss picture mickeyreiss  Â·  5Comments

mrkolby picture mrkolby  Â·  4Comments