Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
shouldComponentUpdate(nextProps: ExtensionSlotProps) {
return !compare(this.props, nextProps);
}
shouldComponentUpdate(nextProps: ExtensionSlotProps) {
return !compare(this.props, nextProps);
}
function updateData(
id: string,
state: FormDataState,
updateState: StateUpdater,
newData: TFormData,
options: InputFormOptions,
) {
const { onChange } = options;
updateState(id, state, {
currentData: newData,
changed: !compare(newData, state.initialData),
error: undefined,
});
if (isfunc(onChange)) {
Promise.resolve(onChange(newData))
.then(data => {
const updatedData = { ...newData, ...data };
updateState(id, state, {
currentData: updatedData,
changed: !compare(updatedData, state.initialData),
error: undefined,
});
})
.catch(error =>
updateState(id, state, {
error,
.then(data => {
const updatedData = { ...newData, ...data };
updateState(id, state, {
currentData: updatedData,
changed: !compare(updatedData, state.initialData),
error: undefined,
});
})
.catch(error =>