Gatsby: On "part-one" tutorial page, some step outputs an error

Created on 26 Dec 2018  路  4Comments  路  Source: gatsbyjs/gatsby

Summary

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?

question or discussion

Most helpful comment

@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?

All 4 comments

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

signalwerk picture signalwerk  路  3Comments

theduke picture theduke  路  3Comments

mikestopcontinues picture mikestopcontinues  路  3Comments

jimfilippou picture jimfilippou  路  3Comments

timbrandin picture timbrandin  路  3Comments