/
server-components.test.ts.snap
42 lines (29 loc) · 1.79 KB
/
server-components.test.ts.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Error Overlay for server components createContext called in Server Component should show error when React.createContext is called 1`] = `
" 1 of 1 unhandled error
Server Error
TypeError: createContext only works in Client Components. Add the \\"use client\\" directive at the top of the file to use it. Read more: https://beta.nextjs.org/docs/rendering/server-and-client-components#context
This error happened while generating the page. Any console logs will be displayed in the terminal window.
app/page.js (3:24) @ React
1 |
2 | import React from 'react'
> 3 | const Context = React.createContext()
| ^
4 | export default function Page() {
5 | return (
6 | <>"
`;
exports[`Error Overlay for server components createContext called in Server Component should show error when React.createContext is called in external package 1`] = `
" 1 of 1 unhandled error
Server Error
TypeError: createContext only works in Client Components. Add the \\"use client\\" directive at the top of the file to use it. Read more: https://beta.nextjs.org/docs/rendering/server-and-client-components#context
This error happened while generating the page. Any console logs will be displayed in the terminal window.
null"
`;
exports[`Error Overlay for server components createContext called in Server Component should show error when createContext is called in external package 1`] = `
" 1 of 1 unhandled error
Server Error
TypeError: createContext only works in Client Components. Add the \\"use client\\" directive at the top of the file to use it. Read more: https://beta.nextjs.org/docs/rendering/server-and-client-components#context
This error happened while generating the page. Any console logs will be displayed in the terminal window.
null"
`;