StephenGrider / FullstackReactCode

Companion repo to https://www.udemy.com/node-with-react-fullstack-web-development
1.39k stars 1.17k forks source link

this.props.fetchUser() unresolved function in webstorm (App.js) #29

Closed rostgoat closed 6 years ago

rostgoat commented 6 years ago
componentDidMount() {
        this.props.fetchUser();
    }

while working though the tutorial, fetchUser() is labelled as undefined in webstorms even when import {fetchUser} from "../actions"; is declared.

any fixes?

eponymz commented 6 years ago

So I started having this same issue in vscode.. I had to define my files as JavaScript React format. Regular javascript formatting was making everything go all wonky..

rostgoat commented 6 years ago

could you provide the code you used?

eponymz commented 6 years ago

That was an IDE specific setting. Curious, when you started the project in webstorm, did you start it as a blank project? Or did you choose the react project template?

rostgoat commented 6 years ago

I actually started it in Atom but switched to webstorm shortly after. Once I opened and ran the create-react-app i was prompted my webstorm to allow it to work with React libraries to which I said yes.

eponymz commented 6 years ago

I actually moved mine from webstorm to vs code. I'm not quite sure how to define jsx as the file format in webstorm. Since it's still javascript.

rostgoat commented 6 years ago

oh gotcha.

Somehow it magically started working now after I imported that import statement above. Not exactly sure what the issue was there. this.props.fetchUser(); is still unresolved but seems to work without errors.

Closing issue.