View
This component calls a view defined in the application. This can be used to create reusable views across the application and call them from anywhere.
The view must be defined and references in the index.js root file of the application.
Examples
Simple view
Create a file that will contain the view.
module.exports = (users, _props) => {
return {
"type": "text",
"value": "This is a view",
};
}
Then instantiate the view in the root view of the application.
module.exports = (users, _props) => {
return {
"type": "flex",
"children": [
{
"type": "text",
"value": "This the root view",
},
// Will call myView and show the "This is a view" text
{
"type": "view",
"name": "myView",
}
]
};
}
Properties
Attribute | Description | Type |
---|---|---|
_type | The identifier of the component |
|
name | The name of the view | string |
context | The context projection. This field represents the projection of the context, allowing selective retrieval of specific elements. It is a map that specifies the desired elements to be included in the projection. | object |
find | Find query. | Find |
props | Parameters passed to the listener | object |