warning requireNativeComponent running on web
Opened this issue · 0 comments
learncodingforweb commented
WARNING in ./node_modules/react-native-magic-move/src/clone/NativeCloneComponent.js 205:73-95
export 'requireNativeComponent' (imported as 'requireNativeComponent') was not found in 'react-native-web/dist/index' (possible exports:
Webpack config
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
mode: 'development',
entry: './src/index.js',
output: {
path: path.resolve(__dirname, './release'),
filename: 'bundle.js',
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: './index.html',
}),
],
module: {
rules: [
{
test: /\.(js|jsx)$/,
include: [
path.resolve('src'),
path.resolve('node_modules/react-native-magic-move'),
],
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: [
'babel-plugin-react-native-web',
'@babel/plugin-proposal-class-properties',
],
},
},
},
],
},
devServer: {
contentBase: path.join(__dirname, 'release'),
compress: true,
port: 4000,
historyApiFallback: true,
},
resolve: {
alias: {
'react-native$': 'react-native-web',
},
extensions:[
'.web.js',
'.web.jsx',
'.web.ts',
'.web.tsx',
'.js',
'.jsx',
'.ts',
'.tsx',
]
},
};
using packages
"dependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-native-magic-move": "^0.6.6",
"react-native-web": "^0.15.0"
},
"devDependencies": {
"@babel/core": "^7.13.10",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/preset-env": "^7.13.10",
"@babel/preset-react": "^7.12.13",
"babel-loader": "^8.2.2",
"babel-plugin-react-native-web": "^0.15.0",
"html-webpack-plugin": "^5.3.1",
"prettier": "^2.2.1",
"webpack": "^5.26.0",
"webpack-cli": "^4.5.0",
"webpack-dev-server": "^3.11.2"
},