Hi, @thesavoyard77. It seems you misunderstood how Netlify works. Your site code cannot modify the deployed files. The only way to modify the deployed files is to make a new deploy.
The following support guide has more information:
About this:
Honestly I don’t think I’ll ever deploy a react app to Netlify again. What should be 10 minutes turns into 8 hours of trouble shooting. It’s a time crunch during coding challenges and nothing works.
It might have helped if you made sure what you wanted to do could be done without server side processing (it’s not) and if server side processing is possible at Netlify (which it isn’t outside of functions).
If there are other questions about this, please let us know.