-
Notifications
You must be signed in to change notification settings - Fork 483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditions "if" #29
Comments
Hi @Zirconiumirish, Yes, it is possible and there are a few ways to do this, some more "proper" than others. I do want to point out that our platform is built on top of React-Native and so, you can use most React-Native modules, components, etc in conjunction with your Viro application (you just can't put React-Native views in React-Viro components). Essentially, you want to store state and the recommended way of doing so in React-Native is using a state-tracking framework such as Redux or Relay. Those are fully-fledged solutions that are used in many deployed React-Native apps, but do require some setup and learning on your behalf. However, because React-Native is built on Javascript and Node, we can also transfer information through the use of modules and/or global variables. In the below gist, I've added a Code here: So for you to do what you want, you could create 3 variables in a separate module, and as your user answers questions, update those values in the first scene. Then when you are ready for the second scene, simply import that module and access the values. This would work for now, but if you have the time, I'd take a look at a more "proper" state-management module/system. I've tested this and it looks like it does work between scenes (but that's not shown in the gist). If it doesn't work, apparently you can also use the Let me know if that works. Thanks, Andy *Note: I believe on iOS you'll need Xcode to see the console.log output even from JS, and they'll look something like this: |
Closing this issue due to lack of activity. Feel free to reopen this issue, create another issue or contact us at support@viromedia.com. Thanks! |
Hello ViroTeam,
Do you think that we can setup conditions with your plateform like :
Imagine there are 3 questions with 3 differents answers for each question only one answer is valid per question (Like True/False)
Building something like
IF specific buttons are clicked during the 3 questions THEN we can show the results on another
scene
Do you think it might work, I'm embarrassed to ask you again if you are able to build an exemple for this. If you can't I can understand
Thanks in advance
Michael
The text was updated successfully, but these errors were encountered: