react-click-outside
react-click-outside copied to clipboard
Defunct with parcel, babel 7
This modules doesn't play well with parcel and babel 7.
package.json:
{
...
"main": "src/index.js",
"scripts": {
"start": "parcel html/index.html"
},
"devDependencies": {
"@babel/core": "^7.6.0",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/preset-env": "^7.6.0",
"@babel/preset-react": "^7.0.0",
"eslint": "^6.4.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx": "^0.1.0",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-standard": "^4.0.1",
"parcel-bundler": "^1.12.3"
},
"dependencies": {
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-trello": "^2.2.3"
}
}
.babelrc:
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": ["@babel/plugin-proposal-class-properties"]
}
If I import react-click-outside with the settings above, I get this error:
react-click-outside/build/index.js: Plugin/Preset files are not allowed to export objects, only functions. In /home/mike/workspace/burnmaster/node_modules/react-click-outside/node_modules/babel-preset-react/lib/index.js
I have no idea why this happens. I've tried to reproduce the issue using normal require with babel-node, but I couldn't get it to produce the same error.