Skip to content

Commit f745d03

Browse files
docs(v3.1.0): update changelog (#149)
* docs(v3.1.0): update changelog * ci(travis): fix ci failure
1 parent 9227613 commit f745d03

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ node_js:
66
- '12'
77
- '13'
88

9-
before_install:
9+
before_script:
1010
- npm install react@latest react-dom@latest
1111
- npm install codecov -g
1212

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ const TodoList = () => {
5656

5757
## Recently Updated
5858

59+
* [SSR Support: only return asyncState from server side](#ssr-with-nextjs)
5960
* [Expand Context](#expand-context)
60-
* [ModelType Update: NextModelType => ModelType](#model)
6161

6262
## Quick Start
6363

@@ -424,10 +424,10 @@ MyApp.getInitialProps = async (context: NextAppContext) => {
424424
if (!(process as any).browser) {
425425
const initialModels = context.Component.getInitialProps
426426
? await context.Component.getInitialProps(context.ctx)
427-
await getInitialState() // get all model initialState
428-
// : await getInitialState({ modelName: 'Home' }) // get Home initialState only
429-
// : await getInitialState({ modelName: ['Home', 'Todo'] }) // get multi initialState
430-
// : await getInitialState({ data }) // You can also pass some public data as asyncData params.
427+
await getInitialState(undefined, { isServer: true }) // get all model initialState
428+
// : await getInitialState({ modelName: 'Home' }, { isServer: true }) // get Home initialState only
429+
// : await getInitialState({ modelName: ['Home', 'Todo'] }, { isServer: true }) // get multi initialState
430+
// : await getInitialState({ data }, { isServer: true }) // You can also pass some public data as asyncData params.
431431
return { initialModels }
432432
} else {
433433
return { persistModel }
@@ -470,7 +470,7 @@ export default () => {
470470
```tsx
471471
// ...
472472
Benchmark.getInitialProps = async () => {
473-
return await getInitialState({ modelName: 'Todo' })
473+
return await getInitialState({ modelName: 'Todo' }, { isServer: true })
474474
}
475475
```
476476
</p>

__test__/SSR/index.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/// <reference path="../index.d.ts" />
2-
import '@testing-library/react/cleanup-after-each'
32
import { Model } from '../../src'
43
import { SSRCounter } from '..'
54

0 commit comments

Comments
 (0)