Application Android et IOS pour l'amicale des élèves https://play.google.com/store/apps/details?id=fr.amicaleinsat.application
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

withCollapsible.js 1002B

1234567891011121314151617181920212223242526272829303132333435
  1. // @flow
  2. import * as React from 'react';
  3. import {useCollapsibleStack} from 'react-navigation-collapsible';
  4. /**
  5. * Function used to manipulate Collapsible Hooks from a class.
  6. *
  7. * Usage :
  8. *
  9. * export withCollapsible(Component)
  10. *
  11. * replacing Component with the one you want to use.
  12. * This component will then receive the collapsibleStack prop.
  13. *
  14. * @param Component The component to use Collapsible with
  15. * @returns {React.ComponentType<any>}
  16. */
  17. export default function withCollapsible(
  18. // eslint-disable-next-line flowtype/no-weak-types
  19. Component: React.ComponentType<any>,
  20. // eslint-disable-next-line flowtype/no-weak-types
  21. ): React$AbstractComponent<any, any> {
  22. // eslint-disable-next-line flowtype/no-weak-types
  23. return React.forwardRef((props: any, ref: any): React.Node => {
  24. return (
  25. <Component
  26. collapsibleStack={useCollapsibleStack()}
  27. ref={ref}
  28. // eslint-disable-next-line react/jsx-props-no-spreading
  29. {...props}
  30. />
  31. );
  32. });
  33. }