Skip to content

Commit 4929545

Browse files
authored
Update Readme.md
1 parent 9b06a22 commit 4929545

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Readme.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The file-system is the main API. Every `.js` file becomes a route that gets auto
88

99
Populate `./pages/index.js` inside your project:
1010

11-
```
11+
```jsx
1212
import React from 'react'
1313
export default () => (
1414
<div>Welcome to next.js!</div>
@@ -28,7 +28,7 @@ So far, we get:
2828

2929
Every `import` you declare gets bundled and served with each page
3030

31-
```
31+
```jsx
3232
import React from 'react'
3333
import cowsay from 'cowsay'
3434
export default () => (
@@ -42,7 +42,7 @@ That means pages never load unneccessary code!
4242

4343
We use [Aphrodite](https://github.com/Khan/aphrodite) to provide a great built-in solution for CSS modularization
4444

45-
```
45+
```jsx
4646
import React from 'react'
4747
import { css, StyleSheet } from 'next/css'
4848

@@ -66,7 +66,7 @@ const styles = StyleSheet.create({
6666

6767
We expose a built-in component for appending elements to the `<head>` of the page.
6868

69-
```
69+
```jsx
7070
import React from 'react'
7171
import Head from 'next/head'
7272
export default () => (
@@ -82,7 +82,7 @@ export default () => (
8282

8383
When state, lifecycle hooks or initial data population you can export a `React.Component`:
8484

85-
```
85+
```jsx
8686
import React from 'react'
8787
export 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
109109
import React from 'react'
110110
import Link from 'next/link'
111111
export default () => (
@@ -115,7 +115,7 @@ export default () => (
115115

116116
#### pages/about.js
117117

118-
```
118+
```jsx
119119
import React from 'react'
120120
export default () => (
121121
<p>Welcome to About!</p>
@@ -141,7 +141,7 @@ Each top-level component receives a `url` property with the following API:
141141

142142
404 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
145145
import React from 'react'
146146
export default ({ statusCode }) => (
147147
<p>An error { statusCode } occurred</p>
@@ -152,14 +152,14 @@ export default ({ statusCode }) => (
152152

153153
To deploy, run:
154154

155-
```
155+
```bash
156156
next build
157157
next start
158158
```
159159

160160
For 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

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy