Repository navigation
Preact compat #2580
Replies: 1 comment
|
yeah, just tried it. @lingui/react 6.4.0 renders fine under preact/compat (preact 10.29). I aliased react and react-dom to preact/compat the usual way (esbuild --alias, same idea as vite's resolve.alias) and SSR-rendered a Trans with value interpolation, an ICU plural, and a useLingui() hook. Output was correct: Lines up with the source too: @lingui/react only pulls createContext/useRef/useCallback/useState/useEffect/useContext from react, all of which preact/compat implements. One gotcha worth flagging: you actually need the alias wired up in your bundler. Without it the real react peer dep gets picked instead and you get an invalid-hook-call crash, which looks like a lingui bug but isn't. |
Uh oh!
There was an error while loading. Please reload this page.
Has anyone tried using
@lingui/reactwithpreact/compat?If so, have you run into any issues or does it work perfectly?
All reactions