tcomb-form-native: React Native Hot Reload breaks tcomb-form-native
Version
tcomb-form-native
:0.4.0
react-native
:0.22.0-rc4
Expected behaviour
React Native 0.22 introduces Hot Reload and after a code change the hot reload behaviour should not break the plugin.
Actual behaviour
After a code change the plugin throws an error.
Steps to reproduce
- New react native project
- Add a
tcomb-form-native
form - Enabled Hot Reload in the app
- Make a change while the app is running
Stack trace and console log
The error that is thrown:
[tcomb][tcomb-form-native] missing stylesheet config
Additional information
- The error is thrown in the
Form.render
method by the assert - The
stylesheet
variable is indeedundefined
after a code change - The other asserts fail as well (
templates
andi18n
) - Hot Reload works by wrapping components with a shell that can reloads its component, so somehow the assignments in the
index.js
file are ignored
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 11
- Comments: 44 (23 by maintainers)
Commits related to this issue
- closes #132 Solves HMR issue by assigning props to the Form class Support for HRM Solved small backward compatibility issue — committed to APSL/tcomb-form-native by deleted user 8 years ago
- closes #132 Solves HMR issue by assigning props to the Form class Support for HRM Solved small backward compatibility issue Solved typo — committed to APSL/tcomb-form-native by deleted user 8 years ago
- Merge pull request #139 from APSL/iss_132 closes #132 Solves HMR issue by assigning props to the Form class — committed to gcanti/tcomb-form-native by gcanti 8 years ago
For those on the same low level as I am, it seems that the import implementation:
does not work as of 0.4.3
Hey guys, is everything ok now?
Sorry @alvaromb, the wrong export was my fault.
@sirwoetang I’m also having that problem “Cannot read property ‘Form’ of undefined”
I can check if moving from require to import solves the HMR issue, and then we could slowly start to move to ES6.
Enviado desde mi iPhone
@gcanti works as a charm, hot reload and all 👍
v0.4.4 released
@alvaromb if that fix works and is really backward compatible (as I hope) I’d say no
Sorry guys I have two important deadlines this week, will try to work on this ASAP.