Instructor: Once you have Enzyme installed in your workflow, it's important to know which version of React you are using. Enzyme has some adapters that need to be installed and configured in order to work with certain React releases.
Create React app has may currently set up with React 16. In order to use Enzyme and set up our test, I need to install a package called enzyme-adapter-react-16.
Once uploaded, we'll see it here. We can now configure our test to use this adapter. We'll go through our app test page and import configure from Enzyme.
Next, we'll import adapter from enzyme-adapter-react-16. We'll use this configure function, which takes an object adapter, new adapter.
Perfect, this is all we need in order to use React 16 in our test with Enzyme. We could have also created a test set-up file and put this in there, because it only needs to be at it once. For simplicity, we will leave it in this file.
Adapters and configurations need to be set up if you're using React 16, 15, 014 or 013. The set-up is the same for each of these versions. The only thing that needs to be changed is the adapter package that we're installing.
If you're working within React 15.5 or higher, that will be the React 15 package. If you're working within 15.0and 15.4, that will be the 15.4. If you're working with the 014, that will be the 14 package, and if you're working with 013, that will be the adapter-react-13.