
I am a novice . this is my code, i want to add this
sorry if i missunderstand your question, but usually i do something like
`
const buttonComponent =
thank you very much, but You may not understand my problems, Simple, in other words,
i hava a button
const demoButton =
how can i add this to a < d i v > , my code is dom.innerHTML = demoButton, but it is wrong,
thanks again.
@ZhangTeng4070 it's solution your problem https://reactjs.org/docs/rendering-elements.html
Also you can call renderToString and you will get html markup your component https://reactjs.org/docs/react-dom-server.html#rendertostring
This looks like a fundamental misunderstanding. Assigning a JSX string to innerHTML is not how React components are meant to be used. You're meant to render the elements using e.g. ReactDOM.render() as shown in the docs.
Have you read through the intro docs yet? That might be helpful. Then if you have specific questions, you might try asking them :smile:
Going to close this issue for now, since I think I answered the question above.