Component should be written as a pure functioneslint(react/prefer-stateless-function)
react
这个报错表示:应该用一个纯函数表示无状态的函数。less
解决报错的方式有下面两种:函数
'React' must be in scope when using JSXeslint(react/react-in-jsx-scope)
eslint
和 Cannot read property 'createElement' of undefined
code
这个报错表示,没有引入React,注意大小写。jsx
解决方式:it
import React from 'react'
;