ghost-portal/packages/react-params/src/Param/Null.tsx
2021-01-03 11:33:39 +01:00

20 lines
434 B
TypeScript

// Copyright 2017-2021 @polkadot/react-params authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Props } from '../types';
import React, { useEffect } from 'react';
function Null ({ onChange }: Props): React.ReactElement<Props> | null {
useEffect((): void => {
onChange && onChange({
isValid: true,
value: null
});
}, [onChange]);
return null;
}
export default React.memo(Null);