Hi,
I am porting one older app to ZF3 + ReactJS.
One nice enhancement would be to have a dedicated view Model/Renderer/Strategy, similar with Json. By example by returning a ReactJsModel the view part to take care of anything else needed:
return new ReactJsModel([
‘component’ => ‘MyComponent’,
‘data1’ => 123
‘data2’ => ‘some other value’
…
]);
Using this the view part should be responsible for creating something as:
ReactDOM.render(React.createElement(MyComponent, {
data1: 123,
data2: 'some other value'
}), document.getElementById('app'));
It’s easy to create a View helper to handle this, but because all the views would be looking the same, just a call to the view helper I guess an entire stack of Model/Renderer/Strategy would be useful. As for Json or Feed…