1. make-event-props
Returns an object with on-event callback props curried with provided args.
make-event-props
Package: make-event-props
Created by: wojtekmaj
Last modified: Wed, 18 Oct 2023 13:22:41 GMT
Version: 1.6.2
License: MIT
Downloads: 4,430,033
Repository: https://github.com/wojtekmaj/make-event-props

Install

npm install make-event-props
yarn add make-event-props

npm downloads CI

Make-Event-Props

A function that, given props, returns an object of event callback props optionally curried with additional arguments.

This package allows you to pass event callback props to a rendered DOM element without the risk of applying any invalid props that could cause unwanted side effects.

tl;dr

  • Install by executing npm install make-event-props or yarn add make-event-props.
  • Import by adding import makeEventProps from 'make-event-props'.
  • Create your event props object:
     const eventProps = useMemo(
      () => makeEventProps(props, (eventName) => additionalArgs),
      [additionalArgs],
    );
    
  • Use your event props:
     return <div {...eventProps} />;
    

License

The MIT License.

Author

Wojciech Maj Wojciech Maj

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code