-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbad.tsx
41 lines (34 loc) · 930 Bytes
/
bad.tsx
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
import styled from 'styled-components';
import { Simple } from '../../components/simple/simple';
import { useBadQuery } from '../../codegen/generated/_graphql';
const TitleBad = styled.h1`
color: #ff7900;
font-size: 24px;
`;
type Props = {
ssr?: boolean;
};
export const Bad = ({ ssr = true }: Props) => {
console.log('[client] render bad');
const { data, loading, error } = useBadQuery({
ssr,
});
if (loading) {
return <>Loading</>;
}
return (
<Simple>
<TitleBad>Bad</TitleBad>
<p>{data && data.bad}</p>
<p>
{Boolean(!error && !loading) && (
<>
We dont get the error, but for sure error is thrown ssr
...
</>
)}
{error && JSON.stringify(error)}
</p>
</Simple>
);
};