Hi, I need to load a html file and then insert it with dangerouslySetInnerHTML
.
How can I do it, I tried fs.readFileSync('./form.html');
but the console logs:
This dependency was not found:
* fs in ./src/components/Contact/index.js
To install it, you can run: npm install --save fs
I guess this is because this uses webpack and not just node, but I'm missing some basic concepts here it seems.
Thanks in advance
You import it using the raw loader e.g. import htmlFile from 'raw-loader!./form.html'
Most helpful comment
You import it using the raw loader e.g.
import htmlFile from 'raw-loader!./form.html'