enzyme adapter react 17
npm install --save-dev @wojtekmaj/enzyme-adapter-react-17
// or
yarn add --dev @wojtekmaj/enzyme-adapter-react-17
import Enzyme from 'enzyme';
// Import Adapter
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
//use adapter
Enzyme.configure({ adapter: new Adapter() });
4.29
7
step by step how to fix enzyme-adapter-react-16 not support for React version 17
step one : npm i npm-install-peers -g
step two copy this :
"peerDependencies": {
"react": "^16.13.1",
"react-dom": "^16.13.1"
}
step three: typing in your terminal npm-install-peers
Thank you!
7
0
4.43
7
import Enzyme from 'enzyme';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
Enzyme.configure({ adapter: new Adapter() });
Thank you!
7
0
3.75
4
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
//dont forget to install 'enzyme-adapter-react-(your React version)' dependency
//In this case 'enzyme-adapter-react-16'
configure({ adapter: new Adapter() });
Thank you!
4
0
0
1
npm i --save-dev enzyme enzyme-adapter-react-16
Thank you!
1
0
4.25
4
how to fix this use this
"peerDependencies": {
"react": "^16.13.1",
"react-dom": "^16.13.1"
}
Thank you!
4
0
Are there any code examples left?
New code examples in category Javascript