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.
syr-cli
version: latestsyr
version: latestProblem 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: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 toindex.js
in the core repo) as opposed tofrom '@syr/core'
. [This is also the way imports are done in the samples.] State updates then work properly when running on emulators.