d31bef29f01f2189127598f2caadf8e77d5d486c.svn-base 605 Bytes
'use strict';
const autoBind = require('.');

const excludedReactMethods = [
	'componentWillMount',
	'UNSAFE_componentWillMount',
	'render',
	'getSnapshotBeforeUpdate',
	'componentDidMount',
	'componentWillReceiveProps',
	'UNSAFE_componentWillReceiveProps',
	'shouldComponentUpdate',
	'componentWillUpdate',
	'UNSAFE_componentWillUpdate',
	'componentDidUpdate',
	'componentWillUnmount',
	'componentDidCatch',
	'setState',
	'forceUpdate'
];

module.exports = (self, {exclude = [], ...options} = {}) => {
	options.exclude = [
		...exclude,
		...excludedReactMethods
	];

	return autoBind(self, options);
};