fix(rnd): Add null checking & remove console logs on Input UI component (#7927)

fix(rnd): And null checking & remove logs
This commit is contained in:
Zamil Majdy
2024-08-30 07:21:09 -05:00
committed by GitHub
parent 5cfa807f00
commit 6d17e627e8
2 changed files with 2 additions and 3 deletions

View File

@@ -157,7 +157,7 @@ export function CustomNode({ data, id, width, height }: NodeProps<CustomNode>) {
current[lastKey.key] = value;
}
console.log(`Updating hardcoded values for node ${id}:`, newValues);
// console.log(`Updating hardcoded values for node ${id}:`, newValues);
if (!isInitialSetup.current) {
history.push({

View File

@@ -11,8 +11,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
// The HTMLvalue will only be updated if the value prop changes, but the user can still type in the input.
ref = ref || React.createRef<HTMLInputElement>();
React.useEffect(() => {
if (ref?.current?.value !== value) {
console.log("Value changed from", ref?.current?.value, "to", value);
if (ref && ref.current && ref.current.value !== value) {
ref.current.value = value;
}
}, [value]);