Fix ESLint issues in DynamicJsonForm.tsx
- Remove unnecessary escape character in regex pattern - Add missing schema dependency to useCallback hook
This commit is contained in:
parent
8d149b2673
commit
a3445c93ff
1 changed files with 2 additions and 2 deletions
|
|
@ -114,13 +114,13 @@ const DynamicJsonForm = forwardRef<DynamicJsonFormRef, DynamicJsonFormProps>(
|
|||
|
||||
// Reset to default for clearly invalid JSON (not just incomplete typing)
|
||||
const trimmed = jsonString.trim();
|
||||
if (trimmed.length > 5 && !trimmed.match(/^[\s\[{]/)) {
|
||||
if (trimmed.length > 5 && !trimmed.match(/^[\s[{]/)) {
|
||||
onChange(generateDefaultValue(schema));
|
||||
}
|
||||
}
|
||||
}, 300);
|
||||
},
|
||||
[onChange, setJsonError],
|
||||
[onChange, setJsonError, schema],
|
||||
);
|
||||
|
||||
// Update rawJsonValue when value prop changes
|
||||
|
|
|
|||
Loading…
Reference in a new issue