"response-router" does not contain an export named "Link",

I am using response-router@4.1.1

└─┬ react-router@4.1.1
  ├─┬ history@4.6.1
  │ ├── resolve-pathname@2.1.0
  │ └── value-equal@0.2.1
  └── warning@3.0.0

and this message appears in development when the Link jet router is connected

./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';

It appears that the change to react-router@2.0.1 version is working. Does anyone know if Link was removed from the reactor? What happened to Link?

If not, why am I getting this error?

+6
source share
1 answer

4.x introduced some hacked changes, you will need to import Linkfrom react-router-dom:

Commonjs

var Link = require('react-router-dom').Link

ES6 Modules

import { Link } from 'react-router-dom'

: https://github.com/ReactTraining/react-router/tree/master/packages/react-router-dom

+26

All Articles