0.1.0 • Published 5 years ago

use-event-callback v0.1.0

Weekly downloads
973
License
ISC
Repository
-
Last release
5 years ago

React hook useEventCallback

Aimed to be easier to use than useCallback and solve problems raised in this ticket.

useEventCallback doesn't need any dependencies list. The returned function should not be used during rendering.

Example

import useEventCallback from 'use-event-callback';

const Input = () => {
  const [value, setValue] = useState('');
  const onChange = useEventCallback((event) => {
    setValue(event.target.value);  
  });

  return <input value={value} onChange={onChange} />;
}
react-image-annotate-filterable@everything-registry/sub-chunk-3026holman-react-image-annotateimage-annotate-reactnew_ns_workflow_workspacemtc-react-image-annotatens_workflow_image_annotationns_workflow_workspacens_workflow_workspace_layoutns_workflow_workspace_testreact-image-annotate-customreact-image-annotate-forkreact-image-annotate-masterreact-image-annotate-master-customreact-image-annotate-prabathreact-image-annotate-prop-2react-image-annotate-switchonreact-image-annotate-switchon-ratanreact-image-annotate-switchon-ratan1react-image-annotate-switchon1react-image-bound-boxreact-image-annotate_ns_demoreact-image-annotate_ns_demo_brushreact-image-taggerreact-imannotatereact-image-labelingreact-material-workspacereact-material-workspace-layoutreact-material-workspace-layout-testreact-multiple-image-annotatereact-native-accessibility-actionsreact-native-paper-snackbar-stackreact-nlp-annotatereact-nlp-annotate-forkreact-nlp-jtreact-time-seriesreact-time-series-testreact-visual-novelreact-wound-image-annotatereact-image-annotatereact-image-annotate-2react-image-annotate-cnreact-image-annotate-coonereact-image-annotate-adexereact_image_annotate_ns_workflowreact_image_annotate_ns_workflow_3react_image_annotate_ns_workflow_7react_image_annotate_ns_workflow_8react_image_annotate_ns_workflow_9react_image_annotate_nsworkflow_2024rn-pepperuniversal-data-tooluniversal-data-tool-testtusk-annotatetusk-annotate-tooltyped-react-navigatoryss-image-annotateworkflow_workspaceworkspace-rohit@wcarpenter96/react-image-annotateai-image-annotatorannotate-workspace-layoutcustom-react-image-annotate@dataunion.app/react-annotate@dataunion/react-annotate@dataunion/react-material-workspace-layoutcoraldd-react-image-annotatecoraldd-universal-data-tool@formeum/core@eylonkoenig/react-image-annotate@intelligence-stack/react-image-annotate@infinitebrahmanuniverse/nolb-use-e@purpl_me/purpl-ui-lib@rediminds/image-video-annotator@rediminds/react-material-workspace-layout@searpent/react-image-annotate@silentnerd/react-image-annotate@shahn681/react-material-workspace-layout@starwit/react-image-annotate
0.1.0

5 years ago