/
githubmirror
/
react-hook-form
Обзор
Документация
Войти
/
githubmirror
/
react-hook-form
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/__tests__/controller.server.test.tsx
27 строк
687 B
Bill
🏛️ build(esm): Use explicit .mjs extension for ESM, with CJS interop (#7… (#7262)
13 дек 2021, 14:43
Не верифицирован
13 дек 2021, 14:43
892aa0d
Код
Авторство
О чём код?
import React from 'react'; import { renderToString } from 'react-dom/server'; import { Controller } from '../controller'; import { useForm } from '../useForm'; describe('Controller with SSR', () => { // issue: https://github.com/react-hook-form/react-hook-form/issues/1398 it('should render correctly with as with component', () => { const Component = () => { const { control } = useForm<{ test: string; }>(); return ( <Controller defaultValue="default" name="test" render={({ field }) => <input {...field} />} control={control} /> ); }; renderToString(<Component />); }); });