Skip to content

Conversation

@sbowl001
Copy link

No description provided.

@wlharvey4
Copy link

Stephanie-
I downloaded your app, installed dependencies, started your app with yarn start, and received a warning and an error.

The warning was A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object. The error was MoviesList(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object. The warning and the error appear to be from the same problem.

I debugged the issue and found this:

Your MoviesList.js return needed to wrap the entire return statement in parentheses; without doing so causes the function to return only a portion of the code, not the entire code as a unit. Making that change causes your app to function properly.

I would also recommend keeping the App.js component call as a single unit without spaces, like so: <MoviesList movies={this.state.movies} />; it is allowed to have line breaks, but it is better to keep your props calls without spaces, and to only use a line break when you have a multitude of props to call, and it would be too much for one line. With just one prop, it is easier to read on line line.

Other than those little details, your app worked great. Nice job.

Wesley

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants