react-country-flag
react-country-flag copied to clipboard
Having issue during ssr?
import ReactCountryFlag from "react-country-flag";
export default function PortalNew() {
return (
<div>
<ReactCountryFlag countryCode="us" svg />
</div>
);
}
This is giving error at remix or nextjs app:
Any idea?
If you still haven't solved it, try setting @svgr/loader in next.config.mjs
const nextConfig = {
webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
use: [
{
loader: '@svgr/webpack',
options: {
svgo: false,
},
},
],
});
return config;
},
...
}