This package has been deprecated

Author message:

WARNING: This module became a part of @scaleflex/ui. See https://github.com/scaleflex/ui/ for more information.

@sfx-ui/hooks

1.0.0-beta.1 • Public • Published

@sfx-ui/hooks

Batch of useful UI-related React hooks.


Installation

npm i @sfx-ui/hooks # react react-dom
yarn add @sfx-ui/hooks # react react-dom

Make sure to have react and react-dom installed in your package as they are included in our peer dependencies.

Usage

Every hook functions is exported by default and should be used inside React components with respect to the rules of hooks.

import useMediaQuery from '@sfx-ui/hooks/use-portal';

/**
 * @example
 * <PortalComponent>
 *   <p>Portal content</p>
 * </PortalComponent>
 */
const PortalComponent = ({ id, children }) => {
  const target = usePortal(id);

  return createPortal(
    children,
    target,
  );
};

Readme

Keywords

Package Sidebar

Install

npm i @sfx-ui/hooks

Weekly Downloads

0

Version

1.0.0-beta.1

License

MIT

Unpacked Size

6.54 kB

Total Files

7

Last publish

Collaborators

  • vitaly.shaposhnik