16
16
*/
17
17
18
18
import AutoNumeric , { CallbackOptions } from "autonumeric" ;
19
- import { ReactHTML , createElement , useEffect , useRef } from "react" ;
19
+ import { createElement , useEffect , useRef } from "react" ;
20
20
21
21
/** The base React component integrated with {@link !AutoNumeric}.
22
22
*
23
23
* This component is used as a base to construct higher-level React component that integrates with
24
- * AutoNumeric. See {@link AutoNumericInput} for a live example.
24
+ * AutoNumeric. See {@link AutoNumericInput} for a live example. For some elements, you would also
25
+ * need to set the
26
+ * [`contenteditable`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable)
27
+ * attribute to true.
25
28
*
26
29
* @param options - Options of the component.
27
30
* @param options.element - The element of the component, such as `"input"`.
@@ -32,6 +35,9 @@ import { ReactHTML, createElement, useEffect, useRef } from "react";
32
35
* AutoNumeric!Options}.
33
36
* @param options.state - The React state that controls and is controlled by {@link !AutoNumeric}.
34
37
* If absent, this component will not interact with its parent via React states.
38
+ *
39
+ * @see [AutoNumeric: On which elements can it be
40
+ * used?](https://docs.autonumeric.org/Documentation/on%20which%20elements%20can%20it%20be%20used/)
35
41
*/
36
42
export default function AutoNumericComponent ( {
37
43
element,
@@ -40,7 +46,7 @@ export default function AutoNumericComponent({
40
46
autoNumericOptions,
41
47
state,
42
48
} : {
43
- element : keyof ReactHTML ;
49
+ element : string ;
44
50
refKey : string ;
45
51
props ?: Parameters < typeof createElement > [ 1 ] ;
46
52
autoNumericOptions ?: CallbackOptions ;
0 commit comments