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

use useInsertionEffect if available #1606

Closed behnammodi closed 2 years ago

behnammodi commented 2 years ago

Corresponding Issue(s):

What Would You Like to Add/Fix?

Well, our React peerDependencies is >=16.8.6 so some projects maybe use React 18 we can use useInsertionEffect if available, also change is just one line

const useEffectOrLayoutEffect = isInBrowser ? React.useInsertionEffect || React.useLayoutEffect : React.useEffect

Todo

Expectations on Changes

Nothing

Changelog

use useInsertionEffect if available

enisdenjo commented 2 years ago

Already landed with https://github.com/cssinjs/jss/pull/1604.

behnammodi commented 2 years ago

Already landed with #1604.

Thanks to inform me, I will close this PR

kof commented 2 years ago

released 10.9.1-alpha.0