-
Notifications
You must be signed in to change notification settings - Fork 26.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
76 changed files
with
871 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# `href` Interpolation Failed | ||
|
||
#### Why This Error Occurred | ||
|
||
Somewhere you are utilizing the `next/link` component, `Router#push`, or `Router#replace` with `href` interpolation to build dynamic routes but did not provide all of the needed dynamic route params to properly interpolate the `href`. | ||
|
||
Note: this error will only show when the `next/link` component is clicked not when only rendered. | ||
|
||
**Invalid `href` interpolation** | ||
|
||
```jsx | ||
import Link from 'next/link' | ||
|
||
export default function BlogLink() { | ||
return ( | ||
<Link | ||
href={{ | ||
pathname: '/blog/[post]/[comment]', | ||
query: { post: 'post-1' }, | ||
}} | ||
> | ||
<a>Invalid link</a> | ||
</Link> | ||
) | ||
} | ||
``` | ||
|
||
**Valid `href` interpolation** | ||
|
||
```jsx | ||
import Link from 'next/link' | ||
|
||
export default function BlogLink() { | ||
return ( | ||
<Link | ||
href={{ | ||
pathname: '/blog/[post]/[comment]', | ||
query: { post: 'post-1', comment: 'comment-1' }, | ||
}} | ||
> | ||
<a>Valid link</a> | ||
</Link> | ||
) | ||
} | ||
``` | ||
|
||
#### Possible Ways to Fix It | ||
|
||
Look for any usage of the `next/link` component, `Router#push`, or `Router#replace` and make sure that the provided `href` has all needed dynamic params in the query. | ||
|
||
### Useful Links | ||
|
||
- [Routing section in Documentation](https://nextjs.org/docs/routing/introduction) | ||
- [Dynamic routing section in Documentation](https://nextjs.org/docs/routing/dynamic-routes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
import Link from 'next/link' | ||
import NextEditor from '../components/NextEditor' | ||
import React, { useState, useMemo } from 'react' | ||
import { createEditor } from 'slate' | ||
import { Slate, Editable, withReact } from 'slate-react' | ||
import { withHistory } from 'slate-history' | ||
|
||
const IndexPage = (props) => { | ||
const IndexPage = () => { | ||
const [value, setValue] = useState(initialValue) | ||
const editor = useMemo(() => withHistory(withReact(createEditor())), []) | ||
return ( | ||
<> | ||
<Link href="/multiple"> | ||
<a>Go to multiple</a> | ||
</Link> | ||
<hr /> | ||
<NextEditor | ||
slateKey="someUniqueKey" | ||
defaultValue="This is editable plain text, just like a <textarea>!" | ||
/> | ||
</> | ||
<Slate editor={editor} value={value} onChange={(value) => setValue(value)}> | ||
<Editable placeholder="Enter some plain text..." /> | ||
</Slate> | ||
) | ||
} | ||
|
||
const initialValue = [ | ||
{ | ||
children: [ | ||
{ text: 'This is editable plain text, just like a <textarea>!' }, | ||
], | ||
}, | ||
] | ||
|
||
export default IndexPage |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,7 @@ | |
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
.next/ | ||
|
||
# production | ||
/build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,5 @@ | |
"registry": "https://registry.npmjs.org/" | ||
} | ||
}, | ||
"version": "9.5.4-canary.6" | ||
"version": "9.5.4-canary.12" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.