Ash Ash - 23 days ago 6
React JSX Question

ESLint React PropTypes with JSX

I'm using the Airbnb javascript standards to lint my react app and i'm getting an error i'm not sure how to fix. I'm passing in another component in order to create a page about the component itself, including the component itself (children) a title and a markdown description. I get a bunch of errors for each of those items like this.

'children' is missing in props validation - react/prop-types


I can see that it is because i'm not defining props, but I can't figure out how to get it working.

I'm essentially outputting something like the below.

const example = ({ title, children, description }) => (
{title}
{md.render(description)}
{children}
)


How would I define my Props in this situation?

Ash Ash
Answer

I ended up working this out, I just had typos in my original code!