All Projects → zekchan → react-ssr-error-boundary

zekchan / react-ssr-error-boundary

Licence: other
No description or website provided.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-ssr-error-boundary

React Lazy Load Image Component
React Component to lazy load images and components using a HOC to track window scroll position.
Stars: ✭ 755 (+2187.88%)
Mutual labels:  react-component, server-side-rendering
React Router Server
Server Side Rendering library for React Router v4.
Stars: ✭ 443 (+1242.42%)
Mutual labels:  react-component, server-side-rendering
errors
errors with paired message and caller stack frame
Stars: ✭ 19 (-42.42%)
Mutual labels:  error-handling
boldr
React based CMF / blogging engine using Redux, Postgres, Node, and more...
Stars: ✭ 78 (+136.36%)
Mutual labels:  server-side-rendering
catchr
catchr: Flexible, useful tools for dealing with conditions in R, for new users and veterans
Stars: ✭ 17 (-48.48%)
Mutual labels:  error-handling
md-svg-vue
Material design icons by Google for Vue.js & Nuxt.js (server side support & inline svg with path)
Stars: ✭ 14 (-57.58%)
Mutual labels:  server-side-rendering
react-github-contribution-calendar
A React component for GitHub-like heatmap calendar
Stars: ✭ 100 (+203.03%)
Mutual labels:  react-component
react-treeview-component
A react tree-component where user can customize the the tree according to their need
Stars: ✭ 18 (-45.45%)
Mutual labels:  react-component
nars
Server rendered React Native
Stars: ✭ 85 (+157.58%)
Mutual labels:  server-side-rendering
React-Jupyter-Viewer
A react component to embed .ipyb notebooks in a blog or something
Stars: ✭ 50 (+51.52%)
Mutual labels:  react-component
Figicons
📦 150+ packaged & ready icons, designed in Figma. Ships with support for custom line icons.
Stars: ✭ 20 (-39.39%)
Mutual labels:  react-component
laravel-ignition
A beautiful error page for Laravel apps
Stars: ✭ 276 (+736.36%)
Mutual labels:  error-handling
fractal-component
A javascript library that can help you to encapsulate decoupled UI component easily
Stars: ✭ 13 (-60.61%)
Mutual labels:  server-side-rendering
react-notification-alert
React bootstrap 4 notification alert
Stars: ✭ 34 (+3.03%)
Mutual labels:  react-component
universal-react-relay-starter-kit
A starter kit for React in combination with Relay including a GraphQL server, server side rendering, code splitting, i18n, SEO.
Stars: ✭ 14 (-57.58%)
Mutual labels:  server-side-rendering
react-super-styled
Responsive JSX layouts with Styled Components
Stars: ✭ 77 (+133.33%)
Mutual labels:  react-component
react-amap
基于 React 封装的高德地图组件,助你轻松的接入高德地图到 React 项目中。
Stars: ✭ 73 (+121.21%)
Mutual labels:  react-component
fail
Better error handling solution specially designed for web application servers
Stars: ✭ 27 (-18.18%)
Mutual labels:  error-handling
rsp
A server-state reactive Java web framework for building real-time user interfaces and UI components.
Stars: ✭ 35 (+6.06%)
Mutual labels:  server-side-rendering
react-critical-css
Extracts your critical CSS.
Stars: ✭ 18 (-45.45%)
Mutual labels:  server-side-rendering

React SSR error boundary

NPM version codecov Dev Dependency Status

React 16 introduced new componentDidCatch lifecycle method, but it is not working when you render page on server using renderToString. If you want just render fallback when your component throw error you can use react-ssr-error-boundary.

Installation:

Add the latest version of react-ssr-error-boundary to your package.json:

npm install react-ssr-error-boundary

or

yarn add react-ssr-error-boundary

Usage:

Code below will render <div>Error Fallback</div> on server if ProblemComponent rendering fails:

import ErrorFallBack from 'react-ssr-error-boundary'


function App() {
  return <ErrorFallBack fallBack={() => <div>Error Fallback</div>}>
    <ProblemComponent />
  </ErrorFallBack>
}

If yours ProblemComponent depends on context (your are using Redux for example), you should create your own ErrorFallBack component by providing contextTypes:

import { withContext } from 'react-ssr-error-boundary'
const ErrorFallBack = withContext({ store: PropTypes.object })

function App() {
  return <ErrorFallBack fallBack={() => <div>Error Fallback</div>}>
    <ProblemComponent />
  </ErrorFallBack>
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].