Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
027d7ab1
Unverified
Commit
027d7ab1
authored
Apr 05, 2024
by
Alexander
Committed by
GitHub
Apr 05, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: fix code snippet in next/script (#64119)
Removed unintended use of `PagesOnly` component inside a code block.
parent
0baa85de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
script.mdx
docs/02-app/02-api-reference/01-components/script.mdx
+6
-6
No files found.
docs/02-app/02-api-reference/01-components/script.mdx
View file @
027d7ab1
...
@@ -363,14 +363,14 @@ export default function Page() {
...
@@ -363,14 +363,14 @@ export default function Page() {
<PagesOnly>
<PagesOnly>
```jsx
```jsx
import { useRef } from 'react'
;
import { useRef } from 'react'
import Script from 'next/script'
;
import Script from 'next/script'
export default function Page() {
export default function Page() {
const mapRef = useRef()
;
const mapRef = useRef()
return (
return (
<
PagesOnly
>
<>
<div
ref=
{mapRef}
></div>
<div
ref=
{mapRef}
></div>
<Script
<Script
id=
"google-maps"
id=
"google-maps"
...
@@ -379,11 +379,11 @@ export default function Page() {
...
@@ -379,11 +379,11 @@ export default function Page() {
new google.maps.Map(mapRef.current, {
new google.maps.Map(mapRef.current, {
center: { lat: -34.397, lng: 150.644 },
center: { lat: -34.397, lng: 150.644 },
zoom: 8,
zoom: 8,
})
;
})
}}
}}
/>
/>
</>
</>
)
;
)
}
}
```
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment