I have the following configuration as JSON
var componentConfig = { content: { type: "ContentContent", data: "content"}, new_content: { type: "ContentFormContent", data: "content"} }
In real rendercomponent, is it possible to dynamically pass the component name for the render reaction.
for example, in this render component, instead of directly placing a ContentFormContent, you can pass data from json config, and I can execute a loop or something else.
React.renderComponent(<ContentFormContent data={[componentConfig.new_content.data]} />, body);
SO I will have a list of pages in json config and based on the choice of a particular nav I will display the component based on its "type" from the json file
javascript reactjs
V1n0d
source share