@@ -8,7 +8,7 @@ The file-system is the main API. Every `.js` file becomes a route that gets auto
88
99Populate ` ./pages/index.js ` inside your project:
1010
11- ```
11+ ``` jsx
1212import React from ' react'
1313export default () => (
1414 < div> Welcome to next .js ! < / div>
@@ -28,7 +28,7 @@ So far, we get:
2828
2929Every ` import ` you declare gets bundled and served with each page
3030
31- ```
31+ ``` jsx
3232import React from ' react'
3333import cowsay from ' cowsay'
3434export default () => (
@@ -42,7 +42,7 @@ That means pages never load unneccessary code!
4242
4343We use [ Aphrodite] ( https://github.com/Khan/aphrodite ) to provide a great built-in solution for CSS modularization
4444
45- ```
45+ ``` jsx
4646import React from ' react'
4747import { css , StyleSheet } from ' next/css'
4848
@@ -66,7 +66,7 @@ const styles = StyleSheet.create({
6666
6767We expose a built-in component for appending elements to the ` <head> ` of the page.
6868
69- ```
69+ ``` jsx
7070import React from ' react'
7171import Head from ' next/head'
7272export default () => (
@@ -82,7 +82,7 @@ export default () => (
8282
8383When state, lifecycle hooks or initial data population you can export a ` React.Component ` :
8484
85- ```
85+ ``` jsx
8686import React from ' react'
8787export default class extends React .Component {
8888 async getInitialProps ({ isServer, req }) {
@@ -105,7 +105,7 @@ Client-side transitions between routes are enabled via a `<Link>` component
105105
106106#### pages/index.js
107107
108- ```
108+ ``` jsx
109109import React from ' react'
110110import Link from ' next/link'
111111export default () => (
@@ -115,7 +115,7 @@ export default () => (
115115
116116#### pages/about.js
117117
118- ```
118+ ``` jsx
119119import React from ' react'
120120export default () => (
121121 < p> Welcome to About! < / p>
@@ -141,7 +141,7 @@ Each top-level component receives a `url` property with the following API:
141141
142142404 or 500 errors are handled both client and server side by a default component ` error.js ` . If you wish to override it, define a ` _error.js ` :
143143
144- ```
144+ ``` jsx
145145import React from ' react'
146146export default ({ statusCode }) => (
147147 < p> An error { statusCode } occurred< / p>
@@ -152,14 +152,14 @@ export default ({ statusCode }) => (
152152
153153To deploy, run:
154154
155- ```
155+ ``` bash
156156next build
157157next start
158158```
159159
160160For example, to deploy with ` now ` a ` package.json ` like follows is recommended:
161161
162- ```
162+ ``` json
163163{
164164 "name" : " my-app" ,
165165 "dependencies" : {
0 commit comments