This repository has been archived on 2026-03-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
StasisWarden-Legacy/node_modules/auto-bind/react.js
T

29 lines
613 B
JavaScript

import autoBind from './index.js';
const excludedReactMethods = [
'componentWillMount',
'UNSAFE_componentWillMount',
'render',
'getSnapshotBeforeUpdate',
'componentDidMount',
'componentWillReceiveProps',
'UNSAFE_componentWillReceiveProps',
'shouldComponentUpdate',
'componentWillUpdate',
'UNSAFE_componentWillUpdate',
'componentDidUpdate',
'componentWillUnmount',
'componentDidCatch',
'setState',
'forceUpdate',
];
export default function autoBindReact(self, {exclude = [], ...options} = {}) {
options.exclude = [
...exclude,
...excludedReactMethods,
];
return autoBind(self, options);
}