Skip to content

Commit 8c1c24d

Browse files
authored
liveValidate/liveOmit: mark only boolean option as deprecated (#4886)
1 parent 673c3f2 commit 8c1c24d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/core/src/components/Form.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ import _unset from 'lodash/unset';
5656
import getDefaultRegistry from '../getDefaultRegistry';
5757
import { ADDITIONAL_PROPERTY_KEY_REMOVE, IS_RESET } from './constants';
5858

59+
/** Represents a boolean option that is deprecated.
60+
* @deprecated - In a future major release, this type will be removed
61+
*/
62+
type DeprecatedBooleanOption = boolean;
63+
5964
/** The properties that are passed to the `Form` */
6065
export interface FormProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> {
6166
/** The JSON schema object for the form */
@@ -184,9 +189,9 @@ export interface FormProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F e
184189
* is provided, then live validation will be performed when a field that was updated is blurred (as a performance
185190
* optimization).
186191
*
187-
* @deprecated - In a future major release, the `boolean` options for this flag will be removed
192+
* NOTE: In a future major release, the `boolean` options for this flag will be removed
188193
*/
189-
liveValidate?: boolean | 'onChange' | 'onBlur';
194+
liveValidate?: 'onChange' | 'onBlur' | DeprecatedBooleanOption;
190195
/** Flag that describes when live omit will be performed. Live omit happens only when `omitExtraData` is also set to
191196
* to `true` and the form's data is updated by the user.
192197
*
@@ -195,9 +200,9 @@ export interface FormProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F e
195200
* is provided, then live omit will be performed when a field that was updated is blurred (as a performance
196201
* optimization).
197202
*
198-
* @deprecated - In a future major release, the `boolean` options for this flag will be removed
203+
* NOTE: In a future major release, the `boolean` options for this flag will be removed
199204
*/
200-
liveOmit?: boolean | 'onChange' | 'onBlur';
205+
liveOmit?: 'onChange' | 'onBlur' | DeprecatedBooleanOption;
201206
/** If set to true, then extra form data values that are not in any form field will be removed whenever `onSubmit` is
202207
* called. Set to `false` by default.
203208
*/

0 commit comments

Comments
 (0)