UNPKG

@proca/widget

Version:

Proca is an open-source campaign toolkit designed to empower activists and organisations in their digital advocacy efforts. It provides a flexible and customisable platform for creating and managing online petitions, email campaigns, and other forms of di

21 lines (16 loc) 404 B
import React, { useEffect } from "react"; const HiddenField = props => { const { register, setValue } = props.form; const { name, value } = props; useEffect(() => { if (!value) return; setValue(name, value); }, [name, value, setValue]); return ( <input type="hidden" {...register(props.name, { validate: props.validate })} /> ); }; export default HiddenField;