[英]eslint 'App' is assigned warning using with react
I don't see any problem with my code, App is a component and it's used, but eslint gave me this warning 我的代码没有任何问题,App是一个组件并且已使用,但eslint给了我这个警告
./src/containers/app/index.js
Line 6: 'App' is assigned a value but never used no-unused-vars
my code 我的密码
import React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import { ConnectedRouter } from 'react-router-redux'
import store, { history } from './store'
import App from './containers/app'
import './index.css'
const target = document.querySelector('#root')
render(
<Provider store={store}>
<ConnectedRouter history={history}>
<div>
<App />
</div>
</ConnectedRouter>
</Provider>,
target
)
Any clue how to fix that for react? 任何线索如何解决该反应?
The standard ESLint rules don't know anything about JSX. 标准的ESLint规则对JSX一无所知。 You'll need to use https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md in order to get the behavior you want. 您需要使用https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md来获得所需的行为。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.