Is it possible to dynamically create and add view components in React Native? For example, firstly, I only have a blank screen, and information about all the views comes from the server in JSON, and then I need to generate them on the screen. For example, an application receiving json from a server. This json describes the screen to be built:
{ "type": "linearlayout", "subviews": [{ "type": "text", "fields": { "text": "This is text field" }, "styles": { "color": "", "textSize": 14 } }, { "type": "button", "fields": { "text": "JUST BUTTON" }, "transition": { "name": "http://www.link.com" } }, { "type": "text", "fields": { "text": "This is another text field" }, "styles": { "color": "", "textSize": 18 } }] }
So with this JSON, I need to dynamically view the creation in React Native. But I don’t see the possibility of writing JS code inside JSX - only static representations and dynamic props change
source share