no-will-update-set-state.js 380 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 versionUtil = require('../util/version');
  8. module.exports = makeNoMethodSetStateRule(
  9. 'componentWillUpdate',
  10. (context) => versionUtil.testReactVersion(context, '16.3.0')
  11. );