UNPKG

react-browser-form

Version:

<div align="center"> <a href="https://deniskabana.github.io/react-browser-form/introduction" title="React Browser Form - Form management in React made simple for browsers."> <img src="https://raw.githubusercontent.com/deniskabana/react-browser-form/

9 lines (7 loc) 356 B
import { BrowserFormOptions } from "../types"; import { logError } from "./logError"; export function uniqueNameProtection<Schema>(options: BrowserFormOptions<Schema>) { if (document.querySelectorAll(`form[name="${options.name}"]`)?.length > 1) { logError("init", `Form name "${options.name}" is not unique! This can lead to critical bugs!`); } }