Closed oyeanuj closed 4 years ago
Yup, I can confirm the same issue for my SSR implementation as well.
If you're using it with SSR you need to use the commonjs build,
import SelectSearch from 'react-select-search/dist/cjs';
Let me know if that works and if you encounter any other problems, I haven't had a chance to test to render it server side yet, but shouldn't be any problem as I don't use any browser API's on first render.
If you're using it with SSR you need to use the commonjs build,
import SelectSearch from 'react-select-search/dist/cjs';
Let me know if that works and if you encounter any other problems, I haven't had a chance to test to render it server side yet, but shouldn't be any problem as I don't use any browser API's on first render.
Thank you very much. It works.
The CSS has to be loaded separately though.
It will be fun to use the headless part of this package with ChakraUI.
Yeah, you can import it but you would have to map the classes by importing it like this:
import classes from 'react-select-search/style.css';
And then pass a function as the className as described here.
ChakraUI integration sounds interesting, let me know if you make something!
Please update the read me to include something like:
If your using SSR where the CSS has to be included elsewhere you'll need to import using:
import SelectSearch from 'react-select-search/dist/cjs';
import classes from 'react-select-search/style.css';
And then pass a function as the className as described here.
Documentation updated, closing this.
Hi @tbleckert, I'm unable to get it to work with NextJS, seeing the errors below. Any thoughts on how to fix them?