Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changes to node_module not being reflected reactjs

I'm working with react-html-table-to-excel and what I wanted to do was to change the style of the export button. So, I located the file in: node_module/react-html-table-to-excel/src/ReactHTMLTableToExcel.jsx and I changed it how I wanted.

However, when I save the file and refresh the browser, the changes aren't being reflected in the browser. To make sure, I even commented out the whole file and restarted the server and still no changes were made to the export button.

Any help is greatly appreciated!

like image 984
jim Avatar asked Nov 07 '22 22:11

jim


1 Answers

If you want to change the style, better to update it in global style.css file of the project.

Do not change anything in node_modules. It's not your code. It's library code. It's third-party code. It's subject to being replaced/updated every time someone runs npm install, or clones your repo anew, or when the repo version updates. You have no way to even know if a particular file is used at run-time; the HTML file for a component's template probably is not. The package is a black box. Depending on how the library is packaged, the template may well have been pre-compiled in a build step run before the package was published.

like image 123
Animesh Rawat Avatar answered Nov 13 '22 04:11

Animesh Rawat