0.1.1 • Published 2 years ago

@react-hooke/react v0.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

@react-hooke/react

Recipes

useConst

import { useConst } from "@react-hooke/react";

function C(): JSX.Element {
  const one = useConst(() => 1);
  return <>{one}</>;
}

useDependent

import { useDependent } from "@react-hooke/react";

function C({ p1, p2 }: { p1: string; p1: string }): JSX.Element {
  const dependentOnP1AndP2Changing = useDependent(() => `${p1}${p2}`, [p1, p2]);
  return <>{dependentOnP1AndP2Changing}</>;
}