1

I built a small react application using the create-react-app build configuration. The idea is that this app will be used like a widget which takes one parameter, an id of an element that will be used as a container for the app, so it can be embedded into any html page. Has anyone successfully done this? thanks,

this is similar to this this question

2 Answers 2

0

Should be possible. You would just have to figure out a way to initiate react to render within the parent application. You could do this by building your React, then in the parent application point to it so it gets loaded when you wanted it to.

You would also need a way to pass the data from the parent application to the react application more than likely using client side storage of some sort. (sessionStorage, localStorage, window, etc.)

Sign up to request clarification or add additional context in comments.

Comments

0

You could have a config javascript object on the page where you load the react app.

window.config = {

"name":"dani";

}

Then inside the app read window.config and get your values.

You could also use LocalStorage.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.