so i have that big project and everything is on pure javascript like Class.create...prototype and functions that render every component on that page and in render with react.I mean when i type function.createElement("div") somehow it create react div.. and so on and everything is on PURE javascript .. so my question is how can i create file with normal react components and and call that react component from that js file? Thank you
1 Answer
From what I understand from your question is that you need to reuse the react component. For that you need to do two things
Export you react component.You can do it as
module.exports = App;if your react component is like
var App = React.createClass()Secondly in your other react component where you want to reuse this component you can import it as
import {App} from './path/to/resuable/component';Now use this component in the
render() {}function as<App/>
9 Comments
FreakProgrammer
Its not exactly what i want but its close ..For example i have that this.createDialog = new CreateDialog(.....); this.createDialog.className="someClass";
FreakProgrammer
this.dialog = createElement("div"); ... something like that and that is in some function like createDialog:function(){}... and from that function i want to call some react component
Shubham Khatri
It would be helpful if you can share your code and show what you are trying to export
FreakProgrammer
I dont want to create component like that createElement.. and so on
FreakProgrammer
Chat ? for few minutes
|