import React, { Component, PropTypes } from 'react' 

  报错:Cannot resolve symbol 'Component' 
       Cannot resolve symbol 'PropTypes'

1.解决 Cannot resolve symbol 'Component' 

  安装依赖:npm install @types/react --save
  调用方法:import React, { Component } from 'react'

2.解决 Cannot resolve symbol 'PropTypes'

  安装依赖:npm install prop-types --save
  调用方法:import PropTypes from 'prop-types'

注:React.PropTypes 自 React v15.5 起已弃用。请使用 prop-types 库代替。

相关文章:

  • 2021-05-07
  • 2021-04-10
  • 2021-12-19
  • 2021-04-26
  • 2021-12-08
  • 2021-07-01
  • 2022-01-28
  • 2021-06-19
猜你喜欢
  • 2021-08-13
  • 2021-12-03
  • 2022-01-17
  • 2021-08-27
  • 2021-08-14
  • 2021-11-23
  • 2021-05-05
相关资源
相似解决方案