Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix getInitialState description #12785

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/docs/api/runtime-config.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ The return value of `getInitialState()` will become the global initial state. Fo
// src/app.ts
import { fetchInitialData } from "@/services/initial";

export async function () {
export async function getInitialState() {
const initialData = await fetchInitialData();
return initialData;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/docs/api/runtime-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
// src/app.ts
import { fetchInitialData } from "@/services/initial";

export async function () {
export async function getInitialState() {
const initialData = await fetchInitialData();
return initialData;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/docs/max/data-flow.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ For specific usage, please refer to the [micro-frontend's parent-child communica
// src/components/AdminInfo/index.tsx
import { useModel } from 'umi';

export default function Page() {
export default () => {
const { user, fetchUser } = useModel('adminModel', (model) => ({
user: model.admin,
fetchUser: model.fetchAdmin,
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/docs/max/data-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Model 文件允许使用 `.(tsx|ts|jsx|js)` 四种后缀格式,**命名空间

```ts
// src/models/userModel.ts
export default function Page() {
export default () => {
const user = {
username: 'umi',
};
Expand Down
Loading