Skip to content

Commit dc7bb23

Browse files
committed
Add useDefaults warning
1 parent dc19bd9 commit dc7bb23

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

hooks/useDefaults.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type AnyProps = {
1212
// will cast the result to ensure type consistency
1313
// caution, since this is a new state common state issues will apply.
1414
// E.g. access in destructor will not work without a ref (use ref version below instead)
15+
// Caution! If this is used with children this will cause a constant recreation of the children (e.g. textarea cursor jumps to the end)!
1516
export function useDefaults<T>(props: AnyProps, defaultValues: DefaultValues) {
1617
if (!defaultValues) throw new Error("useDefaults - defaultValues is required")
1718

0 commit comments

Comments
 (0)