This file contains hidden or 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
| import { GetServerSidePropsResult } from 'next' | |
| import { IncomingMessage } from 'http' | |
| import { nanoid } from 'nanoid' | |
| import { ASLStore, generateRequestMetaSSR } from '.' | |
| export function calcHttpStatusFromServerSideProps(result: GetServerSidePropsResult<unknown> | null): number { | |
| if (!result) { | |
| return 500 |
This file contains hidden or 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
| import React, { | |
| useCallback, | |
| useState, | |
| useEffect, | |
| FunctionComponent, | |
| } from 'react' | |
| import styled from 'styled-components' | |
| import { useField } from 'payload/components/forms' | |
| import { Field } from 'payload/types' | |
| import Editor from 'rich-markdown-editor' |
This file contains hidden or 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
| import React, { useCallback, FunctionComponent } from 'react' | |
| import { useField } from 'payload/components/forms' | |
| import { Field } from 'payload/types' | |
| import Editor from 'rich-markdown-editor' | |
| // Make sure to never re-render the editor, since it tracks the value on its own. | |
| const MemorizedEditor = React.memo(Editor, (prev, next) => prev.id === next.id) | |
| type FieldWithPath = Field & { path?: string } |