Skip to content

Commit

Permalink
docs(tutorial): update data fetching with welcomepage
Browse files Browse the repository at this point in the history
  • Loading branch information
aliemir committed Feb 14, 2024
1 parent d7e5497 commit 0233e14
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
11 changes: 8 additions & 3 deletions documentation/tutorial/essentials/data-fetching/intro/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@ Then, we'll pass our data provider to `<Refine />` component in `src/App.tsx` fi
Try to add the following code to your `src/App.tsx` file:

```tsx
// We're also removing the `<WelcomePage />` component from the file.
import { Refine } from "@refinedev/core";
import { Refine, WelcomePage } from "@refinedev/core";

// highlight-next-line
import { dataProvider } from "./providers/data-provider";

export default function App(): JSX.Element {
return <Refine dataProvider={dataProvider}></Refine>;
return (
// highlight-next-line
<Refine dataProvider={dataProvider}>
<WelcomePage />
</Refine>
);
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ export const Sandpack = ({ children }: { children: React.ReactNode }) => {
};

const UpdatedAppTsxCode = /* tsx */ `
import { Refine } from "@refinedev/core";
import { Refine, WelcomePage } from "@refinedev/core";
import { dataProvider } from "./providers/data-provider";
export default function App(): JSX.Element {
return <Refine dataProvider={dataProvider}></Refine>;
}
export default function App() {
return (
<Refine dataProvider={dataProvider}>
<WelcomePage />
</Refine>
);
};
`.trim();

const DataProviderTsCode = /* ts */ `
Expand Down
13 changes: 6 additions & 7 deletions documentation/tutorial/essentials/intro/sandpack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ export const Sandpack = ({ children }: { children: React.ReactNode }) => {
};

const AppTsxCode = /* jsx */ `
import React from "react";
import { Refine, WelcomePage } from "@refinedev/core";
export default function App() {
return (
<Refine>
<WelcomePage />
</Refine>
)
}
return (
<Refine>
<WelcomePage />
</Refine>
);
};
`.trim();

const BaseAppTsxCode = /* tsx */ `
Expand Down

0 comments on commit 0233e14

Please sign in to comment.