How to use @rooks/use-input - 3 common examples

To help you get started, we’ve selected a few @rooks/use-input examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github imbhargav5 / rooks / packages / storybook / src / input.js View on Github external
function InputDemo() {
  const myInput = useInput("hello");
  return (
    <div>
      <input>
      <p>
        Value is <b>{myInput.value}</b>
      </p>
    </div>
  );
}
github imbhargav5 / rooks / packages / storybook / src / previous.js View on Github external
function UsePreviousDemo() {
  const myInput = useInput("hello world");
  const previousValue = usePrevious(myInput.value);
  return (
    <div>
      <div>
        <input>
      </div>
      <p>
        Current value is <b>{myInput.value}</b>
      </p>
      <p>
        Previous value was <b>{previousValue || "-"}</b>
      </p>
    </div>
  );
}
github imbhargav5 / rooks / packages / website / components / common / Layout.js View on Github external
const Sidebar = ({ children }) =&gt; {
  const hooks = useContext(HookNamesContext);
  const autoCompleteInput = useInput("");
  const filteredResults = useFilteredNpmResults(autoCompleteInput.value);
  const hooksWithDisplayNames = hooks.map(hookName =&gt; `use-${hookName}`);
  const listToShow = autoCompleteInput.value.length
    ? filteredResults
    : hooksWithDisplayNames;
  return (
    
      {children}
      Hooks

@rooks/use-input

A React Hooks package for input

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis

Popular @rooks/use-input functions