Express React Views screenshot

Express React Views

Author Avatar Theme by Reactjs
Updated: 1 Feb 2022
2726 Stars

This is an Express view engine which renders React components on server. It renders static markup and *does not* support mounting those views on the client.

Categories

Overview

express-react-views is an Express view engine designed to render React components on the server. It is meant to replace traditional server-side view solutions like jade, ejs, or handlebars. Please note that this package is deprecated and no longer maintained. Better alternatives, such as Next.js or Remix, are recommended for new projects.

Features

  • Static Rendering: Renders static markup without support for mounting views on the client.
  • Compatibility: Intended as a replacement for existing server-side view engines like jade, ejs, or handlebars.
  • Options: Ability to customize view rendering with options like doctype, beautify, and babel settings.
  • Views: Views should be Node modules that export React components compiled using Babel presets.
  • Layouts: Composition of layouts by passing props to layout components.
  • Data Handling: Data is accessible in the view through this.props similar to other view engines.

Installation

To install express-react-views, run the following command in your project directory:

npm install express-react-views react

Ensure you have react as a dependency as it is a peer dependency of express-react-views.

Summary

express-react-views is a deprecated Express view engine for rendering React components on the server. It offers features like static rendering, customizable options, and layout composition. However, it is no longer maintained, and developers are recommended to opt for modern alternatives like Next.js or Remix for server-side rendering with React.