Skip to content

Commit

Permalink
Merge pull request #235 from nimaa77/feature/error-pages-fixes
Browse files Browse the repository at this point in the history
Feature/error pages - fix 1
  • Loading branch information
nimaa77 authored Jan 13, 2020
2 parents 3112cd4 + 4866edc commit bba8d5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Next.js is awesome. However, its routing system isn't for me. IMHO React Router
- [Routing](#routing)
- [Parameterized Routing](#parameterized-routing)
- [Client Only Data and Routing](#client-only-data-and-routing)
- [Dynamic 404 and Redirects](#dynamic-404-and-redirects)
- [404 Page](#404-page)
- [Dynamic 404](#dynamic-404)
- [Redirect](#redirect)
- [Code Splitting](#code-splitting)
Expand Down Expand Up @@ -189,7 +189,7 @@ In some parts of your application, you may not need server data fetching at all
would in client land: You can fetch data (in componentDidMount) and do routing
the same exact way.

### Dynamic 404 and Redirects
### 404 Page

React Router 4 can detect No Match (404) Routes and show a fallback component, you can define your custom fallback component in `routes.js` file.

Expand Down
2 changes: 1 addition & 1 deletion src/NotFoundComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class NotFound extends React.Component {
<Route
render={({ staticContext }) => {
if (staticContext) staticContext.statusCode = 404;
return <div>The Page You Were Looking For Was Not Found</div>;
return NotFound.data;
}}
/>
)
Expand Down

0 comments on commit bba8d5a

Please sign in to comment.