radio-buttons-react-native
radio-buttons-react-native copied to clipboard
Question for compile failure of example code
Hi,
I got an error, "Failed to compile" when I run the example code. I am new to React Native and the error location is not in the example code. So I wonder if this is module problem.
Failed to compile C:/ReactNative/TestApp/node_modules/radio-buttons-react-native/RadioButtonRN.js 101:20 Module parse failed: Unexpected token (101:20) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | } |
fadeInAnimation = () => {
| // this.fadeAnim.setValue(0) | Animated.timing(this.state.fadeAnim, { This error occurred during the build time and cannot be dismissed.
Same problem. Any solution to this problem yet?
Found a fix that works on my expo project. Just create a webpack.config.js
file with the following content:
const createExpoWebpackConfigAsync = require("@expo/webpack-config");
module.exports = async function (env, argv) {
const config = await createExpoWebpackConfigAsync(
{
...env,
babel: {
dangerouslyAddModulePathsToTranspile: [
// Ensure that all packages starting with @evanbacon are transpiled.
"RadioButtonRN",
],
},
},
argv
);
return config;
};
Answer from this links https://github.com/expo/expo-cli/tree/master/packages/webpack-config#include-modules
Any solution?
@ceessay I was having the same problem and this worked for me. Thanks!