KO
|
EN
gitlite — search
Search
#javascript
#python
#hacktoberfest
#react
#ai
#typescript
#llm
#go
#golang
#android
#machine-learning
#rust
#deep-learning
#linux
noBind
★ 15
Open GitHub ↗
No more `bind` in JSX
Download README (.md)
Explore Similar Repositories
ng2-wizard
:
No description available.
loadie
:
Android Loaders for the rest of us
locationservice
:
Service to keep a historical record of team member locations
smart-contract
:
couple of smart contracts written in solidity
framer.module.cloudstitch
:
No description available.
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
noBind
?
Download (.md)
# noBind [](http://packagequality.com/#?package=no-bind) [](https://travis-ci.org/RamonGebben/noBind) [](https://badge.fury.io/js/no-bind) No more `bind` in JSX. ## Motivation The reason why I started building this little utility was lead by one of the rules applied in the [React eslint config of Airbnb](https://github.com/airbnb/javascript/tree/master/react#methods). There they point out that when using `.bind` inside of your `render` method will make the amount of memory used by your app bigger with each "rerender". This is because `.bind` return a copy of the that bound function. This utility gives you the same behavior as `.bind` would without making a copy of your function. As so be more memory efficient. ## Usage ```javascript import noBind from 'no-bind'; function clickHandler(id, e) { console.log(id, e); } function MyList(props) { const { listItems } = props; return listItems.map(item => ( <button onClick={noBind(clickHandler, item.id)}> Click Me </button> )) } ```