Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upusage of react components not recognized #872
Comments
This comment has been minimized.
This comment has been minimized.
|
It looks like you're using "ArticleList" and not "Article" - also "React"
isn't used anywhere. I think the errors are right here. If for some reason
you need things to be in scope, you can always disable the checks manually
for this instance.
…On Sun, Apr 30, 2017 at 5:01 PM Roger Gilliar ***@***.***> wrote:
The following code results in two warnings: React and Article unused. Is
this expected ?
import React from 'react'
import Article from './components/article/Article'
import PropTypes from 'prop-types'
function ArticleList ({data, itemState}) {
const listElements = data.map(p => <li key={p.id}><Article data={p.attributes} state={itemState(p.id)}/></li>)
return (<ul className="results">
{listElements}
</ul>)
}
ArticleList.propTypes = {
data: PropTypes.array,
itemState: PropTypes.func
}
export default ArticleList
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#872>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWleovr9B-WiNrRoy3b0ZZlrKPfFdn8ks5r1KJCgaJpZM4NMl9j>
.
|
This comment has been minimized.
This comment has been minimized.
|
No, I'm using Article inside the map function and React is required to make things work. It seems that usages of React components like |
This comment has been minimized.
This comment has been minimized.
|
Oops dang, yeah you're right. Nope, no clue what's up haha. Perhaps someone that uses JSX can help you out (: |
This comment has been minimized.
This comment has been minimized.
dyegolara
commented
May 9, 2017
|
It's not necessary to use JSX in React, the issue is on the .js files too |
This comment has been minimized.
This comment has been minimized.
hhsadiq
commented
Aug 11, 2017
|
@rogergl so how you were able to fix that. Want to use standard with react, but unused var errors are becoming blockers. |
This comment has been minimized.
This comment has been minimized.
oskarhane
commented
Aug 11, 2017
This comment has been minimized.
This comment has been minimized.
|
It looks like this is fixed in the latest version of Could you give it a try? |
Flet
added
the
v11 release
label
Dec 15, 2017
feross
added this to the
standard v11 milestone
Feb 17, 2018
This comment has been minimized.
This comment has been minimized.
|
Changelog: https://github.com/standard/standard/blob/master/CHANGELOG.md#1100---2018-02-18 |
rogergl commentedApr 30, 2017
The following code results in two warnings: React and Article unused. Is this expected ?