Next. js is open-source and provides a simple and general JS framework based on React.
Source: Internet
Author: User
Next. js open-source, provides a simple and general JS framework based on React, and a new general JavaScript framework Next. currently, JavaScript is open-source and provides a new option for Web applications based on React and server.
The team from Zeit built Next on the React Foundation and component model. js also provides a key Extension: By using the component lifecycle Hook method named getInitialProps (), the framework can perform initial rendering on the server, if needed, you can continue rendering on the client. However, this advanced feature is provided by a very small but powerful framework.
According to the minimal function set of Next. js, it provides a convenient way to create a new Web application. In this process, many tool set configurations are not required. Similar to create-react-app, installing this framework builds a React, Webpack, and Babel-based build process. In the past, developers who wrote React components will create pages based on the React syntax. Each page provides a render function:
Import React from 'react 'export default () => Hello world!
Next. js uses filesystem as an API. Therefore, each component in the pages folder is automatically mapped to a server-based route. For example, the pages/about. js component on the disk automatically serves the URL of/about.
Unlike a project like express-react-views, it is a view engine built on Express, and next. js is a top-layer service layer that only renders the results of JavaScript Functions. To achieve this, the project uses glamor to process CSS, instead of relying on a separate CSS file.
The nature of Next. js has some subtle advantages. One of them is that developers do not have to spend time building Webpack or Babel configurations. In the past, these two steps took a lot of time for developers. To run the development version of a website, you only need to run npm run dev.
For some development teams, Universal JavaScript is still a more advanced technology, and many frameworks have their own implementations. Angular 2 has Universal Angular 2 and Ember has Fastboot. In the React field, there are also many options for this, such as Walmart's Electrode and Redfin's React Server. Now, as a simple alternative, Next. js has great potential. This project is open-source on GitHub.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.