Skip to content

Commit 5b671c1

Browse files
authored
docs: fix prettier error (#75968)
1 parent 106e17c commit 5b671c1

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/01-app/03-building-your-application/11-upgrading/08-single-page-applications.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,26 +119,26 @@ export function UserProvider({
119119
```
120120

121121
```js filename="app/user-provider.js" switcher
122-
'use client';
122+
'use client'
123123

124-
import { createContext, useContext, ReactNode } from 'react';
124+
import { createContext, useContext, ReactNode } from 'react'
125125

126-
const UserContext = createContext(null);
126+
const UserContext = createContext(null)
127127

128128
export function useUser() {
129-
let context = useContext(UserContext);
129+
let context = useContext(UserContext)
130130
if (context === null) {
131-
throw new Error('useUser must be used within a UserProvider');
131+
throw new Error('useUser must be used within a UserProvider')
132132
}
133-
return context;
133+
return context
134134
}
135135

136136
export function UserProvider({ children, userPromise }) {
137137
return (
138138
<UserContext.Provider value={{ userPromise }}>
139139
{children}
140140
</UserContext.Provider>
141-
);
141+
)
142142
}
143143
```
144144

@@ -147,12 +147,12 @@ Finally, you can call the `useUser()` custom hook in any client component and un
147147
```tsx filename="app/profile.tsx" switcher
148148
'use client'
149149

150-
import { use } from 'react';
150+
import { use } from 'react'
151151
import { useUser } from './user-provider'
152152

153153
export function Profile() {
154154
const { userPromise } = useUser()
155-
const user = use(userPromise);
155+
const user = use(userPromise)
156156

157157
return '...'
158158
}
@@ -161,12 +161,12 @@ export function Profile() {
161161
```jsx filename="app/profile.js" switcher
162162
'use client'
163163

164-
import { use } from 'react';
164+
import { use } from 'react'
165165
import { useUser } from './user-provider'
166166

167167
export function Profile() {
168168
const { userPromise } = useUser()
169-
const user = use(userPromise);
169+
const user = use(userPromise)
170170

171171
return '...'
172172
}

0 commit comments

Comments
 (0)