0

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. This is my first file in my application and all the other components will follow after this

import React, { Component } from "react";
import PropTypes from 'prop-types';

export default class RootPage extends Component {
render() {
    return <div>{this.props.children}</div>;
    }
}

RootPage.prototype={
    children: PropTypes.node
}

My this.props.children is throwing eslint error 'children' is missing in props validation (react/prop-types)

I have no idea how to fix it, any help is much appreciated

Thanks in advance

0

1 Answer 1

4

You have a typo in propTypes (you have now prototype), try with:

RootPage.propTypes={
    children: PropTypes.node
}
1
  • @spidy, if it worked, could you please mark your question as answered? Commented Apr 5, 2018 at 10:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.