Is it possible to render the react component just by referencing it with its name. For example:
<div>
<MyComponent/>
</div>
All the illustrations and tutorials I have seen, they use ReactDOM.render function to render the component to the target HTML element. But what if I want to repeat the rendering of the component based on server data like this:
<div>
<?php foreach($items as $item):?>
<MyComponent passedData="<?=$item['name'];?>"/>
<?php endforeach;?>
</div>
I know I can use componentWillMount method to request the data from a web service and then render the desired HTML but my application is not in this model (does not use web services). The data gets passed from controller to view and view will render the component n number of times based items count queried from database.
Is that possible?
PS: I am new to react and this is my application in react so apologies if I have missed something in tutorials and documentation.
Thanks.