no-will-update-set-state.js 393 B

1234567891011121314
  1. /**
  2. * @fileoverview Prevent usage of setState in componentWillUpdate
  3. * @author Yannick Croissant
  4. */
  5. 'use strict';
  6. const makeNoMethodSetStateRule = require('../util/makeNoMethodSetStateRule');
  7. const testReactVersion = require('../util/version').testReactVersion;
  8. module.exports = makeNoMethodSetStateRule(
  9. 'componentWillUpdate',
  10. (context) => testReactVersion(context, '>= 16.3.0')
  11. );