/
githubmirror
/
react-hook-form
Обзор
Документация
Войти
/
githubmirror
/
react-hook-form
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/__tests__/formStateSubscribe.server.test.tsx
25 строк
605 B
Noé TATOUD
🎧 feat: <FormStateSubscribe /> component (#13142)
29 ноя 2025, 00:09
Не верифицирован
29 ноя 2025, 00:09
43bcf05
Код
Авторство
О чём код?
import React from 'react'; import { renderToString } from 'react-dom/server'; import { FormStateSubscribe } from '../formStateSubscribe'; import { useForm } from '../useForm'; describe('FormStateSubscribe with SSR', () => { it('should render correctly', () => { const Component = () => { const { control } = useForm<{ test: string; }>(); return ( <FormStateSubscribe control={control} name="test" render={(state) => <span>{state.errors.test?.message}</span>} /> ); }; renderToString(<Component />); }); });