Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'callee' of null 7.20.5 #2743

Closed
Romanior opened this issue Aug 5, 2020 · 1 comment
Closed

TypeError: Cannot read property 'callee' of null 7.20.5 #2743

Romanior opened this issue Aug 5, 2020 · 1 comment

Comments

@Romanior
Copy link

Romanior commented Aug 5, 2020

At version 7.20.5

this code

export const setMainBodyClass = className => {
  if (className && className.trim().indexOf(' ') >= 0) {
    throw Error('You can only set one main body class');
  }
  const { classList } = document.body;
  if (
    className &&
    currentBodyClass === className &&
    classList.contains(className)
  ) {
    return;
  }
  if (currentBodyClass && classList.contains(currentBodyClass)) {
    classList.remove(currentBodyClass);
    currentBodyClass = null;
  }
  if (className && !classList.contains(className)) {
    classList.add(className);
    currentBodyClass = className;
  }
};

line with single return raises:
TypeError: Cannot read property 'callee' of null

Occurred while linting
    at Object.isDestructuredFromPragmaImport (.../node_modules/eslint-plugin-react/lib/util/Components.js:348:33)
    at Object.isCreateElement (.../node_modules/eslint-plugin-react/lib/util/Components.js:393:16)
    at Object.isReturningJSX (.../node_modules/eslint-plugin-react/lib/util/Components.js:467:47)
    at Object.ReturnStatement (.../node_modules/eslint-plugin-react/lib/util/Components.js:942:18)
    at updatedRuleInstructions.(anonymous function) (.../node_modules/eslint-plugin-react/lib/util/Components.js:970:43)
    at listeners.(anonymous function).forEach.listener (.../node_modules/eslint/lib/linter/safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (.../node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (.../node_modules/eslint/lib/linter/node-event-generator.js:254:26)
    at NodeEventGenerator.applySelectors (.../node_modules/eslint/lib/linter/node-event-generator.js:283:22)
@ljharb
Copy link
Member

ljharb commented Aug 6, 2020

Duplicate of #2733.

@ljharb ljharb closed this as completed Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants