Issue 1:
Do you want to request a feature or report a bug?

Reporting a bug.

What is the current behavior?

Context: React Native app, but the error isn't related to the renderer

I'm using a handcrafted <Fetch path="/api/route" render={this.renderChildren} /> component which fetches data and passes it to a ''function as child component", which is rendered. However when using setState to save the call result, I get a pretty interesting error as you can see:

👇 gives you 👇

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template for React 16: https://jsfiddle.net/Luktwrdm/, template for React 15: https://jsfiddle.net/hmbg7e9w/).

I tried to remove all the business logic and reproduce the error from my React Native app. Here is a CodeSandbox which fully reproduce it: https://codesandbox.io/s/pmo6okkz1x.

What is the expected behavior?

I expected not to have this error.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

From what I know: this error occurs on any React renderer (got it on React Native in the first place), and started the project with React 15.5.

Related issues

Might be related to: #11081, #11086.

Ping: @gaearon

Issue 2:
Do you want to request a feature or report a bug?

BUG

What is the current behavior?

When a error boundary receives error from its children and renders a custom error component, react reports "Rendered fewer hooks than expected" on the error component if we have some hooks after the throw statement

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:

https://codesandbox.io/s/error-boundary-hooks-mismatch-tj52l

After clicks "INC" button several times, the page will crash instead of rendering an error label:

Uncaught Invariant Violation: Rendered fewer hooks than expected. This may be caused by an accidental early return statement.
at invariant (https://tj52l.csb.app/node_modules/react-dom/cjs/react-dom.development.js:55:15)
at renderWithHooks (https://tj52l.csb.app/node_modules/react-dom/cjs/react-dom.development.js:13010:28)
at mountIndeterminateComponent (https://tj52l.csb.app/node_modules/react-dom/cjs/react-dom.development.js:15020:13)
at beginWork (https://tj52l.csb.app/node_modules/react-dom/cjs/react-dom.development.js:15625:16)
at performUnitOfWork (https://tj52l.csb.app/node_modules/react-dom/cjs/react-dom.development.js:19312:12)
at workLoop (https://tj52l.csb.app/node_modules/react-dom/cjs/react-dom.development.js:19352:24)
at renderRoot (https://tj52l.csb.app/node_modules/react-dom/cjs/react-dom.development.js:19435:7)
at performWorkOnRoot (https://tj52l.csb.app/node_modules/react-dom/cjs/react-dom.development.js:20342:7)
at performWork (https://tj52l.csb.app/node_modules/react-dom/cjs/react-dom.development.js:20254:7)
at performSyncWork (https://tj52l.csb.app/node_modules/react-dom/cjs/react-dom.development.js:20228:3)
at interactiveUpdates$1 (https://tj52l.csb.app/node_modules/react-dom/cjs/react-dom.development.js:20495:7)
at interactiveUpdates (https://tj52l.csb.app/node_modules/react-dom/cjs/react-dom.development.js:2170:10)
at dispatchInteractiveEvent (https://tj52l.csb.app/node_modules/react-dom/cjs/react-dom.development.js:4882:3)
invariant @ react-dom.development.js:55
renderWithHooks @ react-dom.development.js:13010
mountIndeterminateComponent @ react-dom.development.js:15020
beginWork @ react-dom.development.js:15625
performUnitOfWork @ react-dom.development.js:19312
workLoop @ react-dom.development.js:19352
renderRoot @ react-dom.development.js:19435
performWorkOnRoot @ react-dom.development.js:20342
performWork @ react-dom.development.js:20254
performSyncWork @ react-dom.development.js:20228
interactiveUpdates$1 @ react-dom.development.js:20495
interactiveUpdates @ react-dom.development.js:2170
dispatchInteractiveEvent @ react-dom.development.js:4882

The above error occurred in the <ErrorLabel> component:
in ErrorLabel (created by _default)
in div (created by _default)
in _default

What is the expected behavior?

Although there are some hooks after the throw statement in App component, it should not report hooks mismatch since the render of App is aborted and component type is switched from App to ErrorLabel.

Second, it should not report error at ErrorLabel component, ErrorLabel is only a simple presentational component without any hooks.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

react: 16.8.6

react-dom: 16.8.6