Sending parts of react components from django server to be rendered in a react client server

I have a unique problem statement. I have a client side react server running on port 3000 and a django server of port 8000. Both the servers communicate through rest framework. But I have a situation where I cannot keep the UI code of react in the react frontend so I should send the react(html) code from the django backend(security reasons) so that I could only load that secure UI react component when I receive the html(react compiled) code from the django server(backend).

I think we can use some way to compile the react code from an additional node.js server into html code and keep it in django server. When user with right permissions try to access that component only then the server send the react UI code to the frontend to temporarily display that component in the frontend.

Can I know how this can be achieved if it cam be achieved.

Feel free to ask any additional questions you have regarding the problem statement in the comments.

Back to Top