diff --git a/README.md b/README.md index 267940c..e0b8bf1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/). For a steady stream of TILs from a variety of rocketeers, checkout [til.hashrocket.com](https://til.hashrocket.com/). -_740 TILs and counting..._ +_741 TILs and counting..._ --- @@ -509,6 +509,7 @@ _740 TILs and counting..._ - [Mapping Over One Or Many Children](react/mapping-over-one-or-many-children.md) - [Mock A Function That A Component Imports](react/mock-a-function-that-a-component-imports.md) - [Passing Props Down To React-Router Route](react/passing-props-down-to-react-router-route.md) +- [Prevent reach/router Redirect Error Screen In Dev](react/prevent-reach-router-redirect-error-screen-in-dev.md) - [Proxy To An API Server In Development With CRA](react/proxy-to-an-api-server-in-development-with-cra.md) - [Quickly Search For A Component With React DevTools](react/quickly-search-for-a-component-with-react-devtools.md) - [@reach/router Renders To A Div](react/reach-router-renders-to-a-div.md) diff --git a/react/prevent-reach-router-redirect-error-screen-in-dev.md b/react/prevent-reach-router-redirect-error-screen-in-dev.md new file mode 100644 index 0000000..4854527 --- /dev/null +++ b/react/prevent-reach-router-redirect-error-screen-in-dev.md @@ -0,0 +1,15 @@ +# Prevent reach/router Redirect Error Screen In Dev + +When using [@reach/router's +``](https://reach.tech/router/api/Redirect) with tools like +create-react-app and Gatsby, you'll get those tools' development-mode error +screen overlays whenever a redirect happens. This has to do with how +@reach/router utilizes `componentDidCatch` to change the path without a +render. That error screen overlay can get annoying though. Prevent it with +the `noThrow` prop. + +```javascript +return ( + +); +```