Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected prop type errors on first hot reload when using Context API #1094

Closed
edmorley opened this issue Nov 2, 2018 · 3 comments
Closed
Assignees

Comments

@edmorley
Copy link
Contributor

edmorley commented Nov 2, 2018

Description

When using the new React Context API, the first hot reload results in seemingly invalid prop errors when using react-hot-loader.

Expected behavior

No additional prop type errors by using RHL.

Actual behavior

An unexpected prop type error shown (only) on the first hot reload (notifications is provided by the context):

Warning: Failed prop type: The prop `notifications` is marked as required in `NotificationsMenu`, but its value is `undefined`.
    in NotificationsMenu (at Notifications.jsx:43)
    in HotExportedApp (at src/index.jsx:6)

Environment

  • react-hot-loader: v4.3.12
  • node -v: v11.0.0
  • npm -v: N/A (using yarn)
  • yarn -v: 1.12.0
  • OS: Windows 10
  • Browser: this morning's Firefox Nightly (20181031223503)

Reproducible Demo

  1. Clone https://github.com/edmorley/testcase-react-hot-loader-prop-type-errors
  2. yarn
  3. yarn start
  4. In the browser tab that is then opened, open the devtools console
  5. Edit src/App.jsx (eg adjust the text within the <div>)
  6. Check the browser console for prop type errors

This testcase is derived from the implementation in mozilla/treeherder (mozilla/treeherder#4216 (comment)).

cc @camd.

@edmorley
Copy link
Contributor Author

I've updated the testcase repository to RHL 4.6.1 - the issue still reproduces on the latest version.

@theKashey theKashey self-assigned this Dec 17, 2018
@theKashey
Copy link
Collaborator

4.6.3 should solve the issue.

@edmorley
Copy link
Contributor Author

Many thanks!

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

No branches or pull requests

2 participants