Skip to content

Commit

Permalink
Merge branch 'canary' into bugfix/webpack-out-of-output-path
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra authored Mar 17, 2021
2 parents 30adab7 + a9da48d commit 26ca969
Show file tree
Hide file tree
Showing 59 changed files with 61,468 additions and 62,264 deletions.
29 changes: 28 additions & 1 deletion docs/api-reference/next.config.js/basepath.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Note: this value must be set at build time and can not be changed without re-bui

When linking to other pages using `next/link` and `next/router` the `basePath` will be automatically applied.

For example using `/about` will automatically become `/docs/about` when `basePath` is set to `/docs`.
For example, using `/about` will automatically become `/docs/about` when `basePath` is set to `/docs`.

```js
export default function HomePage() {
Expand All @@ -43,3 +43,30 @@ Output html:
```

This makes sure that you don't have to change all links in your application when changing the `basePath` value.

## Images

When using the [`next/image`](/docs/api-reference/next/image.md) component, you will need to add the `basePath` in front of `src`.

For example, using `/docs/me.png` will properly serve your image when `basePath` is set to `/docs`.

```jsx
import Image from 'next/image'

function Home() {
return (
<>
<h1>My Homepage</h1>
<Image
src="/docs/me.png"
alt="Picture of the author"
width={500}
height={500}
/>
<p>Welcome to my homepage!</p>
</>
)
}

export default Home
```
3 changes: 1 addition & 2 deletions docs/api-reference/next/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ router.push(url, as, options)
- `url` - The URL to navigate to
- `as` - Optional decorator for the URL that will be shown in the browser. Before Next.js 9.5.3 this was used for dynamic routes, check our [previous docs](https://nextjs.org/docs/tag/v9.5.2/api-reference/next/link#dynamic-routes) to see how it worked
- `options` - Optional object with the following configuration options:
- `scroll`: Scroll to the top of the page after a navigation. Defaults to `true`
- [`shallow`](/docs/routing/shallow-routing.md): Update the path of the current page without rerunning [`getStaticProps`](/docs/basic-features/data-fetching.md#getstaticprops-static-generation), [`getServerSideProps`](/docs/basic-features/data-fetching.md#getserversideprops-server-side-rendering) or [`getInitialProps`](/docs/api-reference/data-fetching/getInitialProps.md). Defaults to `false`
- `scroll` - Optional boolean, controls scrolling to the top of the page after navigation. Defaults to `true`
- [`shallow`](/docs/routing/shallow-routing.md): Update the path of the current page without rerunning [`getStaticProps`](/docs/basic-features/data-fetching.md#getstaticprops-static-generation), [`getServerSideProps`](/docs/basic-features/data-fetching.md#getserversideprops-server-side-rendering) or [`getInitialProps`](/docs/api-reference/data-fetching/getInitialProps.md). Defaults to `false`

> You don't need to use `router.push` for external URLs. [window.location](https://developer.mozilla.org/en-US/docs/Web/API/Window/location) is better suited for those cases.
Expand Down
38 changes: 0 additions & 38 deletions examples/with-redux-toolkit/components/add-note.js

This file was deleted.

33 changes: 0 additions & 33 deletions examples/with-redux-toolkit/components/clock.js

This file was deleted.

155 changes: 0 additions & 155 deletions examples/with-redux-toolkit/components/counter.js

This file was deleted.

54 changes: 0 additions & 54 deletions examples/with-redux-toolkit/components/edit-note.js

This file was deleted.

21 changes: 0 additions & 21 deletions examples/with-redux-toolkit/lib/slices/clockSlice.js

This file was deleted.

Loading

0 comments on commit 26ca969

Please sign in to comment.