getDynamicComponent.tsx 395 B

123456789101112131415
  1. import {FunctionComponent} from 'react';
  2. /**
  3. * Returns a replacement component, this function is mocked in tests and will use the second argument.
  4. * (This only happens during tests)
  5. */
  6. export default function getDynamicComponent<Original extends FunctionComponent>({
  7. value,
  8. }: {
  9. fixed: 'textarea';
  10. value: Original;
  11. }): Original {
  12. // Overridden with fixed in tests.
  13. return value;
  14. }