On Part One tutorial, on step "Using sub-components", step 4:
Head back to
src/components/header.js, and make the following change:
export default props => <h1>{props.headerText}</h1>
But when build runs, an error occurs:
Failed to compile
./src/components/header.js
Module Error (from ./node_modules/eslint-loader/index.js):
3:27 error 'props' is not defined no-undef
Is something that the tutorial is wrong or is something that i'm doing wrong?
@AdrianoCahete Can you paste your header.js file after making the change?
The error you are seeing is eslint complaining that props is not defined. Perhaps you forgot to
replace () in export default () => <h1>This is a header.</h1> with props?
Perhaps you forgot to replace ()
Yes, this exactly! Thanks and sorry for that :D
@AdrianoCahete No worries at all, we're here to help 馃檪
Perhaps you forgot to
replace () in export default () =>This is a header.
with props?
That worked for me too. I made the same mistake.
Most helpful comment
@AdrianoCahete Can you paste your
header.jsfile after making the change?The error you are seeing is
eslintcomplaining that props is not defined. Perhaps you forgot toreplace
()inexport default () => <h1>This is a header.</h1>withprops?