usage of react components not recognized
See original GitHub issueThe 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
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top Results From Across the Web
React component not recognized as string or class function
Just try this in your PDF class import React, {Component} from 'react'; import PropTypes from 'prop-types'; import Viewer from '.
Read more >REACT – Simple Intro Component Not Rendering?
Uppercase first characters are used to specify React components, so mainIntro should instead be called MainIntro : const MainIntro = props => ( ......
Read more >Unknown Prop Warning - React
The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as...
Read more >React components not working in Customizer
I am trying to use react components following this tutorial. But when I load the page I am getting a bunch of errors...
Read more >ReactJS Functional Components - GeeksforGeeks
Functional components do not have access to dedicated state ... that can be used for giving the illusion of working with the state...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
<Article/>
are never recognized.🗣 Standard 11 is released! Run
npm install standard@latest --save-dev
to update to the latest version. This will also update the version inpackage.json
✨Changelog: https://github.com/standard/standard/blob/master/CHANGELOG.md#1100---2018-02-18