Hey @christianbote,
thanks a lot! The code from CodeSandbox works well. I also tried like this:
const Quill = () => {
const [reactQuill, setReactQuill] = useState();
const [value, setValue] = useState("");
useEffect(() => {
if (typeof window !== "undefined") {
import("react-quill").then((mod) => {
setReactQuill(mod);
});
}
}, []);
if (reactQuill) {
return (
<div>
<p>Value: {value}</p>
<reactQuill.default theme="snow" value={value} onChange={setValue} />
</div>
);
}
return null;
};
export default connect(Quill);
(I am calling styles for this package in index.js) and it also works. Is that way also okay or should it be strictly like how you did it?
I haven’t noticed that you used loadable() function here, though… Is it because it’s already inside useEffect() function?
Finally, can you (or someone else) please explain, how to know if you would have to use the dynamic import approach for a specific react package or not?