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

Fix: Updated the docs to reflect the current version of [email protected] #431

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
82 changes: 44 additions & 38 deletions docs/next/install-next.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Yey! you are all set, start editing src/pages/index.tsx now.
<Box maxWidth="750px">

```bash
yarn add react-native-web@0.17.1 native-base react-native-svg@12.1.1 react-native-safe-area-context@3.3.2
yarn add react-native-web@0.18.12 native-base react-native-svg@13.4.0 react-native-safe-area-context@4.5.0 expo
```

</Box>
Expand All @@ -109,7 +109,7 @@ yarn add [email protected] native-base [email protected] react-nativ
<Box maxWidth="750px">

```bash
npm install react-native-web@0.17.1 native-base react-native-svg@12.1.1 react-native-safe-area-context@3.3.2
npm install react-native-web@0.18.12 native-base react-native-svg@13.4.0 react-native-safe-area-context@4.5.0 expo
```

</Box>
Expand All @@ -118,7 +118,7 @@ npm install [email protected] native-base [email protected] react-na

</DocTabs>

We'll need 2 more additional steps.
We'll need 3 more additional steps.

1. Install dev dependencies.

Expand All @@ -132,45 +132,51 @@ We'll need 2 more additional steps.
<DocTabItem value="yarn">

```bash
yarn add next-compose-plugins next-transpile-modules @expo/next-adapter next-fonts -D
yarn add @expo/next-adapter -D
```

</DocTabItem>

<DocTabItem value="npm">

```bash
npm i next-compose-plugins next-transpile-modules --save-dev
npm i @expo/next-adapter --save-dev
```

</DocTabItem>

</DocTabs>

2. Update your next.config.js with the below content.
2. Next.js 13.1 introduced a built-in module transpilation, so update your next.config.js with the below content.

```js
const { withExpo } = require("@expo/next-adapter");
const withFonts = require("next-fonts");
const withPlugins = require("next-compose-plugins");
const withTM = require("next-transpile-modules")([
"react-native-web",
"react-native-svg",
"native-base",
"react-native-svg",
]);

const nextConfig = {};

module.exports = withPlugins(
[
withTM,
[withFonts, { projectRoot: __dirname }],
[withExpo, { projectRoot: __dirname }],
// your plugins go here.

module.exports = withExpo({
transpilePackages: [
"react-native",
"expo",
"@react-native-aria",
"react-native-safe-area-context",
"react-native-web",
"react-native-svg",
"native-base",
],
nextConfig
);
experimental: {
forceSwcTransforms: true,
},
});
```

3. Add the following babel.config.js file to the root of your project.

```js
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
};
};
```

### Run the Hello world example
Expand Down Expand Up @@ -229,19 +235,19 @@ export default function App() {
/>
</HStack>
<Box mt="4" pl="0" ml="0">
<HStack pl="0" ml="0" space="4">
<TileLink
title="Utility props"
url="utility-props"
description="Shorthands of commonly used styling props which maps with the provided theme"
className="bg-blueGray-600"
/>
<TileLink
title="NativeBase next adapter"
url="next-adapter"
description="To use Next.js with native-base for web we recommend that you use a library called @native-base/next-adapter to handle the configuration and integration of the tools."
className="bg-blueGray-600"
/>
<HStack pl="0" ml="0" space="4">
<TileLink
title="Utility props"
url="utility-props"
description="Shorthands of commonly used styling props which maps with the provided theme"
className="bg-blueGray-600"
/>
<TileLink
title="NativeBase next adapter"
url="next-adapter"
description="To use Next.js with native-base for web we recommend that you use a library called @native-base/next-adapter to handle the configuration and integration of the tools."
className="bg-blueGray-600"
/>
</HStack>
</Box>
</Box>
Expand Down