Null.tsx 515 B

1234567891011121314151617181920
  1. // Copyright 2017-2020 @polkadot/react-components authors & contributors
  2. // This software may be modified and distributed under the terms
  3. // of the Apache-2.0 license. See the LICENSE file for details.
  4. import { Props } from '../types';
  5. import React, { useEffect } from 'react';
  6. function Null ({ onChange }: Props): React.ReactElement<Props> | null {
  7. useEffect((): void => {
  8. onChange && onChange({
  9. isValid: true,
  10. value: null
  11. });
  12. }, []);
  13. return null;
  14. }
  15. export default React.memo(Null);