Pass arguments or data to new screen. #222
divyanshub024
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I think the best approach is the 1st, but for an optimistic update, I believe the second approach is better. So, I suggest we maintain a local state, along with some kind of widget that can update the child JSON either from signals or from this local state. Furthermore, we can have two types of local states: memory and persistent. {
"type": "observeState",
"persistent": true,
"key": "myState",
"defaultValue": "Hello world",
"bindPath": "child.value",
"child": {
"type": "textInput",
"value": "Hello world",
"onChanged": {
"actionType": "setState",
"key": "myState",
"persistent": true
}
}
} OR {
"type": "textInput",
"value": {
"type": "observeState",
"persistent": true,
"key": "myState",
"defaultValue": "Hello world"
},
"onChanged": {
"actionType": "setState",
"key": "myState",
"persistent": true
}
} The first approach can help us change elements in the JSON tree, but it is more verbose. The second approach is less verbose but more limited in what we can modify in the JSON. What do you think @divyanshub024 ? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While working on an internal app with Mirai, I came up with a situation. The scenario is simple. In Screen A, user enter their email and at Screen B we need to show the email as a text.
There are 2 ways to solve this problem.
I like the second way as it might come in handy in lots of scenarios where we need to pass the data from one screen to another.
@RodolfoSilva @kushalmahapatro @i-asimkhan I want to know your thoughts on this. And what should be the right way to approach his problem.
Beta Was this translation helpful? Give feedback.
All reactions