component.d.ts 687 B

123456789101112131415161718192021
  1. import * as React from 'react';
  2. declare type Props = {
  3. /**
  4. * styles to apply
  5. */
  6. styles: string;
  7. /**
  8. * marks style as dynamic, so it will be reapplied on styles change
  9. * note: this is not expected behavior from a "singleton"
  10. * @default false
  11. */
  12. dynamic?: boolean;
  13. };
  14. /**
  15. * create a Component to add styles on demand
  16. * - styles are added when first instance is mounted
  17. * - styles are removed when the last instance is unmounted
  18. * - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior
  19. */
  20. export declare const styleSingleton: () => React.FC<Props>;
  21. export {};