Skip to content

Releases: atomicojs/hooks

Improves the behavior of a useRouter

17 Mar 23:18
Compare
Choose a tag to compare

Now useRouter uses the object as a reference to useEffect, allowing dynamic changes on the routes object.

With certain special behaviors:

Before each revision useRouter will check the object and cache the response according to the path.
The first state is only defined after useEffect.

Dependencies point to latest

16 Mar 16:25
Compare
Choose a tag to compare

The latest version of Atomico is fixed

Add the useParent hook

13 Mar 18:59
Compare
Choose a tag to compare

useParent

This hook searches the parent node according to a selector, allowing a communication from child to parent.

Import

`js import { useParent } from "@atomico/kit/use-parent"; ''

Syntax

`js const ref = useParent (matches); ''

Where:

  1. ref: Reference whose current is the captured node according to matches.
  2. matches: Selector to identify the parent, Check api Element.matches

2.1.0

04 Mar 17:21
Compare
Choose a tag to compare

Summary

The useListener hook is removed and useCssLightDom is added.

Changes

useListener

It is removed as a hook given the complexity of keeping events memorized.

Upgrades

useCssLightDom

hook that allows associating styles in lightDOM situations

Syntax

  const css = useCssLightDom();

Where:

  1. css : Callback generated by the className..

Example

import { useCssLightDom } from "@atomico/kit/use-css-light-dom";

function component() {
  const css = useCssLightDom();

  return (
    <host>
      <input
        type="checkbox"
        class={css`
          :host {
            transform: scale(2);
          }
          :checked {
            transform: scale(3);
          }
        `}
      />
    </host>
  );
}

Warning this version breaks support for a series of submodules.

19 Feb 03:14
Compare
Choose a tag to compare

Warning this version breaks support for a series of sub-modules in favor of better maintenance.
Now @atomico/kit will focus only on distributing hooks that give a real utility.

Changes

The following hooks are removed.

  1. useCss: To keep the css in lightDOM we recommend using :slotted.
  2. useDelegateFocus: The delegation of the focus event can be made from the virtualDOM..
  3. useCssShadow: Now exists natively in atomico/css.
  4. useQueue: Unnecessary utility.
  5. useSyncEvent: An event-based effect on the virtualDOM is preferable for component synchronization.

Upgrades

  1. Support for package.json#exports
  2. Elimination of Typescript, like Atomico now submodules are distributed without the need to go through a packager.