解析错误:“链接”标识符已被声明

时间:2019-11-21 07:29:36

标签: reactjs react-router-dom

我从第一个反应中得到了两个导入包

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

第二个

import {Link, Element, animateScroll as scroll} from 'react-scroll'

我收到这样的消息:

  

解析错误:“链接”标识符已经声明

如何处理这种情况?

1 个答案:

答案 0 :(得分:1)

类似这样的东西:

import {Link as Link1} from 'react-router-dom'
import {Link as Link2, Element, animateScroll as scroll} from 'react-scroll'