I'm using [email protected]
└─┬ [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ └── [email protected]
└── [email protected]
and this message appears in development when attaching a react-router Link
./src/containers/FilterLink.js
37:4-8 'react-router' does not contain an export named 'Link'.
This is the import code:
import React from 'react';
import { Link } from 'react-router';
By the way changing version to [email protected] seems to be working.
Does anyone know if Link was removed from react-router? what happened with Link?
If not, why do I get this error?
4.x introduced some breaking changes, you'll need to import Link
from react-router-dom
:
CommonJS
var Link = require('react-router-dom').Link
ES6 Modules
import { Link } from 'react-router-dom'
Take a peek here for some additional background: https://github.com/ReactTraining/react-router/tree/master/packages/react-router-dom
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With