question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

usage of react components not recognized

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Apr 30, 2017

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.

1reaction
ferosscommented, Feb 19, 2018

🗣 Standard 11 is released! Run npm install standard@latest --save-dev to update to the latest version. This will also update the version in package.json

Changelog: https://github.com/standard/standard/blob/master/CHANGELOG.md#1100---2018-02-18

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found