Closed sparkdreamstudio closed 8 years ago
I am running into this issue as well. It appears that dynamically generated image names with require are not supported by React Native. It is discussed here: https://github.com/facebook/react-native/issues/2481
My app is failing to launch in the simulator due to this error: https://monosnap.com/file/qNGQQhUkC1Bsr2z2l2lQNmZf4CgQQ4
@sparkdreamstudio : Were you able to find a solution to this issue? I can submit a pull request if needed.
Related to PR #51
@sparkdreamstudio I forked the repo and implemented your suggested fix. It works fine for me. Let me know if you end up using it and if it works on your end: https://github.com/samdturner/react-native-gifted-form
I am not comfortable opening a PR without further understanding of how require works in RN.
@samdturner it worked on my end. As i know, RN packed the image assets and modules with require when compiled. And it will not pack the image without static string in require.So if you using the dynamic string in require module, actually it not exist in the app
Thanks @sparkdreamstudio - I'll open up a PR
On WidgetMixin.js line 215 wrong require should write like
const imageSrc = hasValidationErrors ?require('../icons/delete_sign.png'):require('../icons/checkmark.png');
return ( <Image style={this.getStyle('rowImage')} resizeMode={Image.resizeMode.contain} source={imageSrc} /> );