https://github.com/dzek69/react-autobind-hmr
Wrapper for react-autobind that adds support for projects with React-Hot-Loader (ie: Next.js).
https://github.com/dzek69/react-autobind-hmr
autobind fix javascript react react-autobind react-hmr
Last synced: 7 months ago
JSON representation
Wrapper for react-autobind that adds support for projects with React-Hot-Loader (ie: Next.js).
- Host: GitHub
- URL: https://github.com/dzek69/react-autobind-hmr
- Owner: dzek69
- License: mit
- Created: 2018-03-29T14:00:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-11T01:00:55.000Z (about 2 years ago)
- Last Synced: 2025-02-24T06:39:03.212Z (8 months ago)
- Topics: autobind, fix, javascript, react, react-autobind, react-hmr
- Language: JavaScript
- Size: 648 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# react-autobind-hmr
Wrapper for react-autobind that adds support for projects with React-Hot-Loader (ie: Next.js).
## When to use
If your code is crashing with `Cannot read property of undefined` or similar because you've used `react-autobind`
but it works with `this.method = this.method.bind(this)` - this library is for you.## Usage
Replace your
```javascript
import autobind from "react-autobind";
```with
```javascript
import autobind from "react-autobind-hmr";
```Done.
## Usage (ES5)
If you're using ES5 just `require` `react-autobind-hmr/dist` instead.
## Documentation
There is nothing else than this in documentation. [Documentation](https://dzek69.github.io/react-autobind-hmr/) is here
however in case of update.## License
MIT