Skip to content
Dashboard

Copy link to headingReact Made Easy and Simple

The "Hello World" of Next.js, as presented in our introductory post.

Copy link to headingProgrammatic API

const express = require('express')
const next = require('next')
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
app.prepare().then(() => {
const server = express()
** server.get('/r/:subreddit', (req, res) => {
return app.render(req, res, '/b', {
...req.query,
subreddit: req.params.subreddit
})
})**
server.get('*', (req, res) => {
handle(req, res)
})
server.listen(3000)
})

Implementing Reddit-style fancy URLs with Express and Next.js

Copy link to headingBring Your Own React

npm install --save next react react-dom

Copy link to headingComponent CSS Support

export default () => (
<div>
<p>hi there</p>
<style jsx>{`
p {
color: red;
}
`}</style>
</div>
)

The styles for `p` only apply to the JSX tags defined statically within the scope

Copy link to headingPre-fetching

export default () => (
<div>
<Link href="/next-page" **prefetch**>Go to the next page</Link>
</div>
)

Copy link to headingNext News

Navigating around Next News is snappy!
Navigating around Next News is snappy!

Copy link to headingMore Examples

Copy link to headingScalable HMR (Hot Module Replacement)

Copy link to headingA Smaller Build

Data for a basic site with the Next.js and React bundled
Data for a basic site with the Next.js and React bundled

Copy link to headingFully Extensible

{
"name': "my-next-app",
[]
"babel": {
"presets": ["next/babel"],
"plugins": [[
"transform-define",
"./env-config.js"
]]
}
}

`babel-plugin-transform-define` will let you to replace any JS expression mapped in `env-config.js` at compile time

Copy link to headingFeatured at ReactConf

Next.js: Universal React Made Easy and Simple - React Conf 2017

Copy link to headingThe Road to 3.0

Copy link to headingImproved HMR

Copy link to headingFaster Dev Compilation

Copy link to headingSeamless Support for Lazy import()

Copy link to headingReact Fiber

Copy link to headingStatic Exports

Copy link to headingReady for Production

Ready to deploy?