repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/lib/utils/notify.ts
lib/utils/notify.ts
/* eslint no-new:0 */ export default function notify(title: string, body: string, details: {error?: any} = {}) { console.log(`[Notification] ${title}: ${body}`); if (details.error) { console.error(details.error); } new Notification(title, {body}); }
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/lib/utils/ipc-child-process.ts
lib/utils/ipc-child-process.ts
import type {ExecFileOptions, ExecOptions} from 'child_process'; import {ipcRenderer} from './ipc'; export function exec(command: string, options: ExecOptions, callback: (..._args: any) => void) { if (typeof options === 'function') { callback = options; options = {}; } ipcRenderer.invoke('child_process....
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/lib/utils/rpc.ts
lib/utils/rpc.ts
import {EventEmitter} from 'events'; import type {IpcRendererEvent} from 'electron'; import type { FilterNever, IpcRendererWithCommands, MainEvents, RendererEvents, TypedEmitter } from '../../typings/common'; import {ipcRenderer} from './ipc'; export default class Client { emitter: TypedEmitter<Renderer...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/lib/utils/plugins.ts
lib/utils/plugins.ts
// eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable @typescript-eslint/no-unsafe-return */ import ChildProcess from 'child_process'; import pathModule from 'path'; import React, {PureComponent} from 'react'; import type {ComponentType} from 'react'; import {require as remoteRequire} from...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/lib/utils/file.ts
lib/utils/file.ts
/* * Based on https://github.com/kevva/executable * Since this module doesn't expose the function to check stat mode only, * his logic is pasted here. * * Opened an issue and a pull request about it, * to maybe switch to module in the future: * * Issue: https://github.com/kevva/executable/issues/9 * PR: https:...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/lib/utils/paste.ts
lib/utils/paste.ts
import {clipboard} from 'electron'; import plist from 'plist'; const getPath = (platform: string) => { switch (platform) { case 'darwin': { if (clipboard.has('NSFilenamesPboardType')) { // Parse plist file containing the path list of copied files const list = plist.parse(clipboard.read('NS...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/lib/utils/ipc.ts
lib/utils/ipc.ts
import {ipcRenderer as _ipc} from 'electron'; import type {IpcRendererWithCommands} from '../../typings/common'; export const ipcRenderer = _ipc as IpcRendererWithCommands;
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/lib/utils/effects.ts
lib/utils/effects.ts
import type {Dispatch, Middleware} from 'redux'; import type {HyperActions, HyperState} from '../../typings/hyper'; /** * Simple redux middleware that executes * the `effect` field if provided in an action * since this is preceded by the `plugins` * middleware. It allows authors to interrupt, * defer or add to ex...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/lib/utils/object.ts
lib/utils/object.ts
// eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable @typescript-eslint/no-unsafe-return */ const valsCache = new WeakMap(); export function values(imm: Record<string, any>) { if (!valsCache.has(imm)) { valsCache.set(imm, Object.values(imm)); } return valsCache.get(imm); } const...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/lib/utils/term-groups.ts
lib/utils/term-groups.ts
import type {ITermState} from '../../typings/hyper'; export default function findBySession(termGroupState: ITermState, sessionUid: string) { const {termGroups} = termGroupState; return Object.keys(termGroups) .map((uid) => termGroups[uid]) .find((group) => group.sessionUid === sessionUid); }
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/lib/containers/terms.ts
lib/containers/terms.ts
import type {HyperState, HyperDispatch} from '../../typings/hyper'; import { resizeSession, sendSessionData, setSessionXtermTitle, setActiveSession, openSearch, closeSearch } from '../actions/sessions'; import {openContextMenu} from '../actions/ui'; import Terms from '../components/terms'; import {getRootGr...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/lib/containers/header.ts
lib/containers/header.ts
import {createSelector} from 'reselect'; import type {HyperState, HyperDispatch, ITab} from '../../typings/hyper'; import {closeTab, changeTab, maximize, openHamburgerMenu, unmaximize, minimize, close} from '../actions/header'; import {requestTermGroup} from '../actions/term-groups'; import Header from '../components/...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/lib/containers/notifications.ts
lib/containers/notifications.ts
import type {HyperState, HyperDispatch} from '../../typings/hyper'; import {dismissNotification} from '../actions/notifications'; import {installUpdate} from '../actions/updater'; import Notifications from '../components/notifications'; import {connect} from '../utils/plugins'; const mapStateToProps = (state: HyperSta...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/lib/containers/hyper.tsx
lib/containers/hyper.tsx
import React, {forwardRef, useEffect, useRef} from 'react'; import Mousetrap from 'mousetrap'; import type {MousetrapInstance} from 'mousetrap'; import stylis from 'stylis'; import type {HyperState, HyperProps, HyperDispatch} from '../../typings/hyper'; import * as uiActions from '../actions/ui'; import {getRegistere...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/cli/api.ts
cli/api.ts
// eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable @typescript-eslint/no-unsafe-return */ import fs from 'fs'; import os from 'os'; import path from 'path'; import got from 'got'; import registryUrlModule from 'registry-url'; const registryUrl = registryUrlModule(); // If the user defi...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/cli/index.ts
cli/index.ts
// This is a CLI tool, using console is OK /* eslint no-console: 0 */ import {spawn, exec} from 'child_process'; import type {SpawnOptions} from 'child_process'; import {existsSync} from 'fs'; import {isAbsolute, resolve} from 'path'; import {promisify} from 'util'; import args from 'args'; import chalk from 'chalk'; ...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/typings/config.d.ts
typings/config.d.ts
import type {FontWeight} from 'xterm'; export type ColorMap = { black: string; blue: string; cyan: string; green: string; lightBlack: string; lightBlue: string; lightCyan: string; lightGreen: string; lightMagenta: string; lightRed: string; lightWhite: string; lightYellow: string; magenta: str...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/typings/common.d.ts
typings/common.d.ts
import type {ExecFileOptions, ExecOptions} from 'child_process'; import type {IpcMain, IpcRenderer} from 'electron'; import type parseUrl from 'parse-url'; import type {configOptions} from './config'; export type Session = { uid: string; rows?: number | null; cols?: number | null; splitDirection?: 'HORIZONT...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/typings/extend-electron.d.ts
typings/extend-electron.d.ts
import type {Server} from '../app/rpc'; declare global { namespace Electron { interface App { config: typeof import('../app/config'); plugins: typeof import('../app/plugins'); getWindows: () => Set<BrowserWindow>; getLastFocusedWindow: () => BrowserWindow | null; windowCallback?: (w...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/typings/hyper.d.ts
typings/hyper.d.ts
// eslint-disable-next-line eslint-comments/disable-enable-pair /* eslint-disable import/order */ import type {Immutable} from 'seamless-immutable'; import type Client from '../lib/utils/rpc'; declare global { interface Window { __rpcId: string; rpc: Client; focusActiveTerm: (uid?: string) => void; p...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/typings/ext-modules.d.ts
typings/ext-modules.d.ts
declare module 'php-escape-shell' { export function php_escapeshellcmd(path: string): string; } declare module 'git-describe' { export function gitDescribe(...args: any[]): void; } declare module 'default-shell' { const val: string; export default val; } declare module 'sudo-prompt' { export function exec(...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/typings/constants/config.d.ts
typings/constants/config.d.ts
import type {configOptions} from '../config'; export const CONFIG_LOAD = 'CONFIG_LOAD'; export const CONFIG_RELOAD = 'CONFIG_RELOAD'; export interface ConfigLoadAction { type: typeof CONFIG_LOAD; config: configOptions; now?: number; } export interface ConfigReloadAction { type: typeof CONFIG_RELOAD; config...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/typings/constants/tabs.d.ts
typings/constants/tabs.d.ts
export const CLOSE_TAB = 'CLOSE_TAB'; export const CHANGE_TAB = 'CHANGE_TAB'; export interface CloseTabAction { type: typeof CLOSE_TAB; } export interface ChangeTabAction { type: typeof CHANGE_TAB; } export type TabActions = CloseTabAction | ChangeTabAction;
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/typings/constants/ui.d.ts
typings/constants/ui.d.ts
export const UI_FONT_SIZE_SET = 'UI_FONT_SIZE_SET'; export const UI_FONT_SIZE_INCR = 'UI_FONT_SIZE_INCR'; export const UI_FONT_SIZE_DECR = 'UI_FONT_SIZE_DECR'; export const UI_FONT_SIZE_RESET = 'UI_FONT_SIZE_RESET'; export const UI_FONT_SMOOTHING_SET = 'UI_FONT_SMOOTHING_SET'; export const UI_MOVE_LEFT = 'UI_MOVE_LEFT'...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/typings/constants/notifications.d.ts
typings/constants/notifications.d.ts
export const NOTIFICATION_MESSAGE = 'NOTIFICATION_MESSAGE'; export const NOTIFICATION_DISMISS = 'NOTIFICATION_DISMISS'; export interface NotificationMessageAction { type: typeof NOTIFICATION_MESSAGE; text: string; url: string | null; dismissable: boolean; } export interface NotificationDismissAction { type: ...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/typings/constants/updater.d.ts
typings/constants/updater.d.ts
export const UPDATE_INSTALL = 'UPDATE_INSTALL'; export const UPDATE_AVAILABLE = 'UPDATE_AVAILABLE'; export interface UpdateInstallAction { type: typeof UPDATE_INSTALL; } export interface UpdateAvailableAction { type: typeof UPDATE_AVAILABLE; version: string; notes: string | null; releaseUrl: string; canIns...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/typings/constants/sessions.d.ts
typings/constants/sessions.d.ts
export const SESSION_ADD = 'SESSION_ADD'; export const SESSION_RESIZE = 'SESSION_RESIZE'; export const SESSION_REQUEST = 'SESSION_REQUEST'; export const SESSION_ADD_DATA = 'SESSION_ADD_DATA'; export const SESSION_PTY_DATA = 'SESSION_PTY_DATA'; export const SESSION_PTY_EXIT = 'SESSION_PTY_EXIT'; export const SESSION_USE...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/typings/constants/index.d.ts
typings/constants/index.d.ts
export const INIT = 'INIT'; export interface InitAction { type: typeof INIT; } export type InitActions = InitAction;
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
vercel/hyper
https://github.com/vercel/hyper/blob/2a7bb18259d975f27b30b502af1be7576f6f5656/typings/constants/term-groups.d.ts
typings/constants/term-groups.d.ts
export const TERM_GROUP_REQUEST = 'TERM_GROUP_REQUEST'; export const TERM_GROUP_EXIT = 'TERM_GROUP_EXIT'; export const TERM_GROUP_RESIZE = 'TERM_GROUP_RESIZE'; export const TERM_GROUP_EXIT_ACTIVE = 'TERM_GROUP_EXIT_ACTIVE'; export enum DIRECTION { HORIZONTAL = 'HORIZONTAL', VERTICAL = 'VERTICAL' } export interface...
typescript
MIT
2a7bb18259d975f27b30b502af1be7576f6f5656
2026-01-04T15:43:12.163196Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/cypress.config.ts
cypress.config.ts
import { defineConfig } from 'cypress'; export default defineConfig({ video: false, e2e: { // We've imported your old cypress plugins here. // You may want to clean this up later by importing these. setupNodeEvents(on, config) { // eslint-disable-next-line @typescript-eslint/no-require-imports ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/scripts/jest/setup.ts
scripts/jest/setup.ts
import '@testing-library/jest-dom'; import { jestPreviewConfigure } from 'jest-preview'; // Automatically preview failed tests to Jest Preview Dashboard // https://www.jest-preview.com/blog/automatic-mode jestPreviewConfigure({ autoPreview: true, });
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/scripts/README/Previews/mod.ts
scripts/README/Previews/mod.ts
import individuals from './Individual.js'; import companies from './Company.js'; import helpers from './Helper.js'; export default { individuals, companies, helpers };
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/vite.config.ts
app/vite.config.ts
import reactPlugin from '@vitejs/plugin-react'; import { defineConfig } from 'vite'; // https://vitejs.dev/config/ export default defineConfig({ plugins: [reactPlugin()], // TODO: For now, `pnpm dev` does not do the HMR when we update RHF source code. // It requires to restart the dev server (with --force flag)....
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/test.tsx
app/src/test.tsx
import React from 'react'; import { useFieldArray, useForm } from 'react-hook-form'; import { Control } from '../../src/types'; type FormData = { nest: { test: { value: string; nestedArray: { value: string; }[]; }[]; }; }; const ChildComponent = ({ index, control, }: { contr...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/autoUnregister.tsx
app/src/autoUnregister.tsx
import React, { useState } from 'react'; import ReactSelect from 'react-select'; import { useForm, Controller } from 'react-hook-form'; const options = [ { value: 'chocolate', label: 'Chocolate' }, { value: 'strawberry', label: 'Strawberry' }, { value: 'vanilla', label: 'Vanilla' }, ]; export default function A...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/crossFrameForm.tsx
app/src/crossFrameForm.tsx
import React from 'react'; import ReactDOM from 'react-dom/client'; import { useForm } from 'react-hook-form'; import App from './app'; const FRAME_CONTENT = ` <style> label {display: block; margin-bottom: .5em} form {margin-bottom: 2em} input {margin: 0 1em} </style> <div id='inner-root'> Loadi...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/conditionalField.tsx
app/src/conditionalField.tsx
import React from 'react'; import { useForm } from 'react-hook-form'; let renderCounter = 0; const ConditionalField: React.FC = () => { const { register, handleSubmit, watch, formState: { dirtyFields, isSubmitted, submitCount, touchedFields, isDirty, isSubmitting,...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/form.tsx
app/src/form.tsx
import { useForm, Form } from 'react-hook-form'; import React from 'react'; export default function FormComponent() { const methods = useForm<{ test: string; }>({ defaultValues: { test: '', }, }); return ( <Form control={methods.control} action={'/test'}> <input {...methods.registe...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/customSchemaValidation.tsx
app/src/customSchemaValidation.tsx
import React from 'react'; import { useForm, ValidationMode } from 'react-hook-form'; import Joi from 'joi'; import { useParams } from 'react-router-dom'; let renderCounter = 0; const validationSchema = Joi.object({ firstName: Joi.string().required(), lastName: Joi.string().max(5).required(), min: Joi.number()....
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/setFocus.tsx
app/src/setFocus.tsx
import React from 'react'; import { useForm } from 'react-hook-form'; import type { DefaultValues } from 'react-hook-form'; type FormValues = { focusInput: string; selectInputContent: string; focusTextarea: string; selectTextareaContent: string; }; const defaultValues: DefaultValues<FormValues> = { focusInp...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/reValidateMode.tsx
app/src/reValidateMode.tsx
import React from 'react'; import { useParams } from 'react-router-dom'; import { useForm, ValidationMode } from 'react-hook-form'; type ReValidateMode = 'onBlur' | 'onChange' | 'onSubmit' | undefined; let renderCounter = 0; const Basic: React.FC = () => { const { mode, reValidateMode } = useParams(); const { ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/delayError.tsx
app/src/delayError.tsx
import { useForm } from 'react-hook-form'; import React from 'react'; export function DelayError() { const { register, reset, formState: { errors }, } = useForm({ delayError: 100, mode: 'onChange', defaultValues: { first: '', last: '', }, }); return ( <form> <i...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/setValueWithTrigger.tsx
app/src/setValueWithTrigger.tsx
import React, { useEffect } from 'react'; import { useForm } from 'react-hook-form'; let renderCounter = 0; const SetValueWithTrigger: React.FC = () => { const { register, setValue, handleSubmit, formState: { errors }, } = useForm<{ firstName: string; lastName: string; }>(); useEffect...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/setValueCustomRegister.tsx
app/src/setValueCustomRegister.tsx
import React, { useEffect } from 'react'; import { useForm } from 'react-hook-form'; let renderCounter = 0; const SetValueCustomRegister: React.FC = () => { const { register, setValue, handleSubmit, formState: { touchedFields, isDirty, errors }, } = useForm<{ firstName: string; lastName: s...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/defaultValues.tsx
app/src/defaultValues.tsx
import React from 'react'; import { useForm } from 'react-hook-form'; function DefaultValues() { const { register } = useForm<{ test: string; test1: { firstName: string; lastName: string[]; deep: { nest: string; }; }; checkbox: string[]; }>({ defaultValues: { ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/defaultValuesAsync.tsx
app/src/defaultValuesAsync.tsx
import React from 'react'; import { useForm } from 'react-hook-form'; const sleep = <T,>(data: T, ms: number) => new Promise<T>((res) => setTimeout(() => res(data), ms)); function DefaultValues() { const { register } = useForm({ defaultValues: async () => sleep( { test: 'test', ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/formStateWithSchema.tsx
app/src/formStateWithSchema.tsx
import React from 'react'; import { useForm, ValidationMode } from 'react-hook-form'; import * as yup from 'yup'; import { yupResolver } from '@hookform/resolvers/yup'; import { useParams } from 'react-router-dom'; let renderCounter = 0; const validationSchema = yup .object() .shape({ firstName: yup.string()....
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/manualRegisterForm.tsx
app/src/manualRegisterForm.tsx
import React, { useEffect } from 'react'; import { useForm } from 'react-hook-form'; let renderCounter = 0; const ManualRegisterForm: React.FC = () => { const { register, handleSubmit, formState: { errors }, setValue, } = useForm<{ firstName: string; lastName: string; min: string; ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/main.tsx
app/src/main.tsx
import React from 'react'; import ReactDOM from 'react-dom/client'; import App from './app'; const rootElement = document.getElementById('root')!; const root = ReactDOM.createRoot(rootElement); root.render(<App />);
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/useFormState.tsx
app/src/useFormState.tsx
import React from 'react'; import { useFormState, useForm, Control } from 'react-hook-form'; let renderCounter = 0; type FormInputs = { firstName: string; lastName: string; min: string; max: string; minDate: string; maxDate: string; minLength: string; minRequiredLength: string; selectNumber: string;...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/basicSchemaValidation.tsx
app/src/basicSchemaValidation.tsx
import React from 'react'; import { useForm, ValidationMode } from 'react-hook-form'; import { yupResolver } from '@hookform/resolvers/yup'; import * as yup from 'yup'; import { useParams } from 'react-router-dom'; let renderCounter = 0; const validationSchema = yup .object() .shape( { firstName: yup.st...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/useWatchUseFieldArrayNested.tsx
app/src/useWatchUseFieldArrayNested.tsx
import React from 'react'; import { Controller, useFieldArray, useForm, useWatch, Control, } from 'react-hook-form'; type FormValues = { test: { firstName: string; lastName: string; keyValue: { name: string }[]; }[]; }; function NestedArray({ control, index, }: { control: Control<FormV...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/resetKeepDirty.tsx
app/src/resetKeepDirty.tsx
import React from 'react'; import { useForm } from 'react-hook-form'; function ResetKeepDirty() { const { register, reset, setValue, watch } = useForm<{ firstName: string; lastName: string; objectData: { test: string; }; users: { firstName: string; lastName: string }[]; deepNest: { ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/watch.tsx
app/src/watch.tsx
import React from 'react'; import { useForm } from 'react-hook-form'; const Watch: React.FC = () => { const { register, handleSubmit, watch } = useForm<{ testSingle: string; test: string[]; testObject: { firstName: string; lastName: string; }; toggle: string; }>(); const onSubmit ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/setValue.tsx
app/src/setValue.tsx
import React, { useEffect } from 'react'; import { useForm } from 'react-hook-form'; let renderCounter = 0; const SetValue: React.FC = () => { const { register, setValue, handleSubmit, formState: { errors }, } = useForm<{ firstName: string; lastName: string; age: string; trigger: s...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/watchUseFieldArray.tsx
app/src/watchUseFieldArray.tsx
import React from 'react'; import { useForm, useFieldArray } from 'react-hook-form'; import { useParams } from 'react-router-dom'; let renderCount = 0; type FormInputs = { data: { name: string }[]; }; const WatchUseFieldArray: React.FC = () => { const { mode } = useParams(); const { control, handleSubmit, rese...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/isValid.tsx
app/src/isValid.tsx
import React from 'react'; import { useForm } from 'react-hook-form'; import * as yup from 'yup'; import { yupResolver } from '@hookform/resolvers/yup'; import { useParams } from 'react-router-dom'; let renderCounter = 0; const validationSchema = yup .object() .shape({ firstName: yup.string().required(), ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/formState.tsx
app/src/formState.tsx
import React from 'react'; import { useForm, ValidationMode } from 'react-hook-form'; import { useParams } from 'react-router-dom'; let renderCounter = 0; const FormState = () => { const { mode } = useParams(); const { register, handleSubmit, formState: { dirtyFields, isSubmitted, su...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/controller.tsx
app/src/controller.tsx
import React from 'react'; import { useForm, Controller, ValidationMode } from 'react-hook-form'; import ReactSelect from 'react-select'; import { TextField, Checkbox, Select, MenuItem, Switch, RadioGroup, FormControlLabel, Radio, } from '@mui/material'; import { useParams } from 'react-router-dom'; le...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/useFieldArray.tsx
app/src/useFieldArray.tsx
import React from 'react'; import { useForm, useFieldArray, Controller } from 'react-hook-form'; import { useParams } from 'react-router-dom'; let renderCount = 0; type FormValues = { data: { name: string }[] }; const UseFieldArray: React.FC = () => { const { mode } = useParams(); const withoutFocus: boolean = m...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/triggerValidation.tsx
app/src/triggerValidation.tsx
import React from 'react'; import { useForm } from 'react-hook-form'; let renderCounter = 0; function TriggerValidation() { const { register, trigger, formState: { errors }, } = useForm<{ test: string; test1: string; test2: string; }>(); renderCounter++; return ( <> <inpu...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/basic.tsx
app/src/basic.tsx
import React, { useState } from 'react'; import { useForm, ValidationMode } from 'react-hook-form'; import { useParams } from 'react-router-dom'; let renderCounter = 0; const Basic: React.FC = () => { const { mode } = useParams(); const [data, setData] = React.useState({}); const { register, handleSubmi...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/app.tsx
app/src/app.tsx
import React from 'react'; import { BrowserRouter, Route, Routes } from 'react-router-dom'; import AutoUnregister from './autoUnregister'; import Basic from './basic'; import Watch from './watch'; import BasicSchemaValidation from './basicSchemaValidation'; import CrossFrameForm from './crossFrameForm'; import SetError...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/watchDefaultValues.tsx
app/src/watchDefaultValues.tsx
import React from 'react'; import { useForm } from 'react-hook-form'; function WatchDefaultValues() { const { watch } = useForm({ defaultValues: { test: 'test', test1: { firstName: 'firstName', lastName: ['lastName0', 'lastName1'], deep: { nest: 'nest', }, ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/reset.tsx
app/src/reset.tsx
import React from 'react'; import { useForm } from 'react-hook-form'; function Reset() { const { register, reset } = useForm<{ firstName: string; lastName: string; objectData: { test: string; }; array: string[]; deepNest: { level1: { level2: { data: string; ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/setError.tsx
app/src/setError.tsx
import React, { useEffect } from 'react'; import { useForm } from 'react-hook-form'; import { FieldPath } from '../../src/types'; type FormInputs = { firstName: string; lastName: string; age: string; test: string; test1: string; test2: string; username: string; }; const SetError: React.FC = () => { co...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/formStateWithNestedFields.tsx
app/src/formStateWithNestedFields.tsx
import React from 'react'; import { useForm, ValidationMode } from 'react-hook-form'; import { useParams } from 'react-router-dom'; let renderCounter = 0; const FormStateWithNestedFields = () => { const { mode } = useParams(); const { register, handleSubmit, formState: { dirtyFields, isSub...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/disabledFields.tsx
app/src/disabledFields.tsx
import React from 'react'; import { useForm } from 'react-hook-form'; const toggle = (state: boolean) => !state; export default function DisabledFields() { const [formDisabled, setFormDisabled] = React.useState(false); const [firstDisabled, setFirstDisabled] = React.useState(false); const [secondDisabled, setSe...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/watchUseFieldArrayNested.tsx
app/src/watchUseFieldArrayNested.tsx
import React from 'react'; import { Controller, useFieldArray, useForm, Control } from 'react-hook-form'; type FormValues = { test: { firstName: string; lastName: string; keyValue: { name: string }[]; }[]; }; function NestedArray({ control, index, }: { control: Control<FormValues>; index: numb...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/useFieldArrayNested.tsx
app/src/useFieldArrayNested.tsx
import React from 'react'; import { Controller, useFieldArray, useFormState, useForm, Control, } from 'react-hook-form'; type FormValues = { test: { firstName: string; lastName: string; keyValue: { name: string }[]; }[]; }; function NestedArray({ control, index, }: { control: Control<F...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/setValueStrictMode.tsx
app/src/setValueStrictMode.tsx
import React, { useEffect } from 'react'; import { useForm, Controller } from 'react-hook-form'; const SetValueAsyncStrictMode = () => { const state = React.useRef(new Set()); const [, update] = React.useState({}); const { register, setValue, control } = useForm<{ firstName: string; }>(); useEffect(() =...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/setValueWithSchema.tsx
app/src/setValueWithSchema.tsx
import React, { useEffect } from 'react'; import { useForm } from 'react-hook-form'; import * as yup from 'yup'; import { yupResolver } from '@hookform/resolvers/yup'; let renderCounter = 0; const validationSchema = yup .object() .shape({ lastName: yup.string().min(10).required(), firstName: yup.string()....
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/useFieldArrayUnregister.tsx
app/src/useFieldArrayUnregister.tsx
import React from 'react'; import { useForm, useWatch, useFieldArray, Controller, Control, UseFormReturn, } from 'react-hook-form'; let renderCount = 0; type FormInputs = { data: { name: string; conditional: string }[]; }; const ConditionField = <T extends any[]>({ control, index, unregister, }: ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/validateFieldCriteria.tsx
app/src/validateFieldCriteria.tsx
import React from 'react'; import { useForm } from 'react-hook-form'; let renderCounter = 0; const ValidateFieldCriteria: React.FC = () => { const { register, handleSubmit, formState: { errors }, setError, clearErrors, } = useForm<{ firstName: string; lastName: string; min: string;...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/useWatch.tsx
app/src/useWatch.tsx
import React from 'react'; import { useForm, Control, useWatch, Controller } from 'react-hook-form'; import { useRef } from 'react'; type FormInputs = { test: string; test1: string; test2: string; }; let counter = 0; const GrandChild = ({ control, index = 0, }: { control: Control<FormInputs>; index?: n...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/welcome/index.tsx
app/src/welcome/index.tsx
import React from 'react'; import { Link } from 'react-router-dom'; import * as S from './styles'; type Item = { title: string; description: string; slugs: string[]; }; const items: Item[] = [ { title: 'AutoUnregister', description: 'Should keep all inputs data when inputs get unmounted', slugs: [...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/app/src/welcome/styles.ts
app/src/welcome/styles.ts
export const page: object = { minHeight: '100vh', color: 'white', padding: '1rem', fontFamily: 'Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif', }; export const h1: object = { fontSize: '4rem', fontWeight: '600', textAlign: 'center', marginBottom: '1rem', }; ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/form.tsx
src/form.tsx
import React from 'react'; import { flatten } from './utils/flatten'; import type { FieldValues, FormProps } from './types'; import { useFormContext } from './useFormContext'; const POST_REQUEST = 'post'; /** * Form component to manage submission. * * @param props - to setup submission detail. {@link FormProps} ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/index.react-server.ts
src/index.react-server.ts
export * from './logic'; export * from './utils';
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/useFormState.ts
src/useFormState.ts
import React from 'react'; import getProxyFormState from './logic/getProxyFormState'; import type { FieldValues, UseFormStateProps, UseFormStateReturn, } from './types'; import { useFormContext } from './useFormContext'; import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect'; /** * This custom...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/useFormContext.tsx
src/useFormContext.tsx
import React from 'react'; import type { FieldValues, FormProviderProps, UseFormReturn } from './types'; const HookFormContext = React.createContext<UseFormReturn | null>(null); HookFormContext.displayName = 'HookFormContext'; /** * This custom hook allows you to access the form context. useFormContext is intended ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/useWatch.ts
src/useWatch.ts
import React from 'react'; import generateWatchOutput from './logic/generateWatchOutput'; import deepEqual from './utils/deepEqual'; import type { Control, DeepPartialSkipArrayKey, FieldPath, FieldPathValue, FieldPathValues, FieldValues, InternalFieldName, UseWatchProps, } from './types'; import { useF...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/useForm.ts
src/useForm.ts
import React from 'react'; import getProxyFormState from './logic/getProxyFormState'; import deepEqual from './utils/deepEqual'; import isFunction from './utils/isFunction'; import { createFormControl } from './logic'; import type { FieldValues, FormState, UseFormProps, UseFormReturn, } from './types'; import ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/useController.ts
src/useController.ts
import React from 'react'; import getEventValue from './logic/getEventValue'; import isNameInFieldArray from './logic/isNameInFieldArray'; import cloneObject from './utils/cloneObject'; import get from './utils/get'; import isBoolean from './utils/isBoolean'; import isFunction from './utils/isFunction'; import isUndef...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/watch.tsx
src/watch.tsx
import type { FieldPath, FieldValues, WatchProps, WatchRenderValue, } from './types'; import { useWatch } from './useWatch'; /** * Watch component that subscribes to form field changes and re-renders when watched fields update. * * @param control - The form control object from useForm * @param name - Can b...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/useIsomorphicLayoutEffect.ts
src/useIsomorphicLayoutEffect.ts
import React from 'react'; export const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/controller.tsx
src/controller.tsx
import type { ControllerProps, FieldPath, FieldValues } from './types'; import { useController } from './useController'; /** * Component based on `useController` hook to work with controlled component. * * @remarks * [API](https://react-hook-form.com/docs/usecontroller/controller) • [Demo](https://codesandbox.io/s...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/constants.ts
src/constants.ts
export const EVENTS = { BLUR: 'blur', FOCUS_OUT: 'focusout', CHANGE: 'change', } as const; export const VALIDATION_MODE = { onBlur: 'onBlur', onChange: 'onChange', onSubmit: 'onSubmit', onTouched: 'onTouched', all: 'all', } as const; export const INPUT_VALIDATION_RULES = { max: 'max', min: 'min', ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/formStateSubscribe.tsx
src/formStateSubscribe.tsx
import type { ReactNode } from 'react'; import type { FieldValues, UseFormStateProps, UseFormStateReturn, } from './types'; import { useFormState } from './useFormState'; export type FormStateSubscribeProps< TFieldValues extends FieldValues, TTransformedValues = TFieldValues, > = UseFormStateProps<TFieldVal...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/index.ts
src/index.ts
export * from './controller'; export * from './form'; export * from './formStateSubscribe'; export * from './logic'; export * from './types'; export * from './useController'; export * from './useFieldArray'; export * from './useForm'; export * from './useFormContext'; export * from './useFormState'; export * from './us...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/useFieldArray.ts
src/useFieldArray.ts
import React from 'react'; import generateId from './logic/generateId'; import getFocusFieldName from './logic/getFocusFieldName'; import getValidationModes from './logic/getValidationModes'; import isWatched from './logic/isWatched'; import iterateFieldsByAction from './logic/iterateFieldsByAction'; import updateFiel...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/watch.test-d.ts
src/__typetest__/watch.test-d.ts
import { expectType } from 'tsd'; import { useForm } from '../useForm'; import { Watch } from '../watch'; type FormData = { foo: string; bar: string; baz: { qux: string; }; quux: number; fie: null; foe: { qux: number[] }; }; /** {@link Watch} */ { /** it should have correct types for render funct...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/errors.test-d.ts
src/__typetest__/errors.test-d.ts
import { expectType } from 'tsd'; import type { FieldError, FieldErrors, GlobalError, Merge } from '../types'; import { _ } from './__fixtures__'; /** {@link FieldErrors} */ { /** it should support optional record fields */ { const actual = _ as FieldErrors<{ test?: string; test1?: string; ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/form.test-d.ts
src/__typetest__/form.test-d.ts
import { expectType } from 'tsd'; import { z } from 'zod'; import type { FieldError, FieldValues, Resolver } from '../types'; import { useForm } from '../useForm'; /** {@link UseFormHandleSubmit} */ { /** it should infer the correct defaultValues from useForm */ { /* eslint-disable react-hooks/rules-of-hooks */...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/use-form-context.test-d.ts
src/__typetest__/use-form-context.test-d.ts
import { expectType } from 'tsd'; import { useFormContext } from '../useFormContext'; /** it should correctly infer the output type from useFormContext */ { type Input = { test: string; }; /* eslint-disable react-hooks/rules-of-hooks */ const { handleSubmit } = useFormContext<Input>(); handleSubmit((d...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/form-state-subscribe.test-d.ts
src/__typetest__/form-state-subscribe.test-d.ts
// types/__tests__/formState.tsd.ts import { expectType } from 'tsd'; import { FormStateSubscribe } from '../formStateSubscribe'; import type { FieldValues } from '../types'; import { type UseFormStateReturn } from '../types'; import { useForm } from '../useForm'; /** {@link FormState} */ { type FormType = { fo...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/useController.test-d.ts
src/__typetest__/useController.test-d.ts
import { expectNotType, expectType } from 'tsd'; import { useController } from '../useController'; /** {@link useController} */ { /** it should NOT infer never[] when defaultValue is empty array without explicit types */ { /* eslint-disable react-hooks/rules-of-hooks */ const { field } = useController({ ...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/util.test-d.ts
src/__typetest__/util.test-d.ts
import { expectAssignable, expectType } from 'tsd'; import type { DeepPartial, ExtractObjects, IsAny, IsNever } from '../types'; import { _ } from './__fixtures__'; /** {@link IsAny} */ { /** it should evaluate to true for any */ { const actual = _ as IsAny<any>; expectType<true>(actual); } /** it sho...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/__fixtures__/traversable.ts
src/__typetest__/__fixtures__/traversable.ts
interface Base<T, V> { foo: T; bar: [T]; baz: Array<T>; value: V; } export type InfiniteType<T> = Base<InfiniteType<T>, T>; export type NullableInfiniteType<T> = | null | undefined | Partial<Base<NullableInfiniteType<T>, T>>; export type Depth3Type<T> = Base<Base<Base<never, T>, T>, T>; export interfa...
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false
react-hook-form/react-hook-form
https://github.com/react-hook-form/react-hook-form/blob/a084dcb8597d5fb872ef54c0e8425133d490a711/src/__typetest__/__fixtures__/type.ts
src/__typetest__/__fixtures__/type.ts
/** * tsd expects a value when calling expectType. * We're mostly dealing with types though. Therefore, * simply export this const and cast it to the expected type. * @example * ``` * type Actual = DropLastElement<[0, 1, 2]>; * expectType<[0, 1]>(_ as Actual); * ``` */ export declare const _: never;
typescript
MIT
a084dcb8597d5fb872ef54c0e8425133d490a711
2026-01-04T15:43:31.044549Z
false