Skip to content
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

Importing from '@syr/core' does not allow for state changes #299

Open
ssaxena00 opened this issue Mar 1, 2019 · 0 comments
Open

Importing from '@syr/core' does not allow for state changes #299

ssaxena00 opened this issue Mar 1, 2019 · 0 comments

Comments

@ssaxena00
Copy link

ssaxena00 commented Mar 1, 2019

  • syr-cli version: latest
  • syr version: latest

Problem Description:
After updating state variables in my syr.js class with this.setState({ var: newValue }); and running it in Xcode emulator, I get the following error in Xcode:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: '-[UIView setText:]: unrecognized selector sent to instance 0x7fdd616193d0'
*** 

The issue occurs if importing syr components from the node module @syr/core, which was installed automatically by the syr-cli tool.

Suggested Solution:
I fixed this by adding my syr.js classes to my cloned, local, version of the Syr core repo. In my classes, I imported all syr components from 'index' (referring to index.js in the core repo) as opposed to from '@syr/core'. [This is also the way imports are done in the samples.] State updates then work properly when running on emulators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant