@czaplej/use-ref-constant

Remember initial value

Usage no npm install needed!

<script type="module">
  import czaplejUseRefConstant from 'https://cdn.skypack.dev/@czaplej/use-ref-constant';
</script>

README

@czaplej/use-ref-constant

license npm latest package

Remember the initial value of function

Installation

npm

npm install --save  @czaplej/use-ref-constant

yarn

yarn add  @czaplej/use-ref-constant

Usage

const App = (props) => {
  // always return the initial props
  const initialValue = useRefConstant(() => props);

  return <>...</>;
};

This library was generated with Nx.