cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.08k stars 399 forks source link

react-jss function values do not work as expected in React 18 #1614

Closed bsShoham closed 2 years ago

bsShoham commented 2 years ago

Expected behavior: function values should be rendered into the stylesheet

Describe the bug: function values in react 18 do not get into the stylesheet.

Reproduction:

the following are two examples of the same code, on with react 17.0.2 and one with react 18.1.0, in the react 17 example the button renders into the html the class (class name) and the function value (color of text), in the 18 example it will not render the value only the class name.

React 17.0.2: https://codesandbox.io/s/react-jss-react-17-ftlcel?file=/src/App.js

React 18.1.0 https://codesandbox.io/s/react-jss-react-18-sp533b?file=/src/App.js

Versions (please complete the following information):

Managing expectations:

I think that this is due to some breaking changes in React 18, but tbh I have no idea, I just assume further support for react 18 is needed

bsShoham commented 2 years ago

didn't notice it's a duplicate of #1597 closing