for my side project, I want to make a React app that has a textarea where you can paste code snippets in it and then hit save. Then I will store it into a database linked to their user account id for later retrieval.
I wanted to try using encodeURI at first but I couldn't even store the code inside a variable yet. Can anyone point me in the right direction? I'd appreciate it so much!
Although the general consensus is the risk is not high storing it. But it is high while retrieving and injecting it in the DOM for rendering.
So you should be good storing the the data as a string. But you'll have to be updated about any possible security issues that might pop up later that needs patching.