question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

weird issue with `react/jsx-no-bind`

See original GitHub issue

this is my .eslintrc:

{
    "root": true,
    "parser": "babel-eslint",
    "extends": "airbnb",
    "ecmaFeatures": {
        "classes": true,
        "jsx": true
    },
    "plugins": [
      "react"
    ],
    "rules": {
      "react/display-name": 1,
      "react/jsx-filename-extension":0,
      "react/jsx-no-bind": 2,
      "semi": [ 2, "never" ],
      "import/no-extraneous-dependencies": 0,
      "no-use-before-define": 0,
      "no-underscore-dangle": 0,
      "import/prefer-default-export": 0,
    }
}

For some reason, the rule react/jsx-no-bind doesn’t work for me while extending airbnb. If I remove the "extends": "airbnb",, I get lint errors, but when I extend, lint ignores any setting I might have and doesn’t show errors/warning at all.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13

github_iconTop GitHub Comments

2reactions
Kufertcommented, Feb 17, 2017

"react/jsx-no-bind": [2, {}] worked for me

0reactions
edgar0011commented, Oct 23, 2018

Sure, but why would you want to use yml for config when you have any other choice

  1. you come to a project wehere yaml already is, due to many reasons
  2. yaml has some advantages over json: Advantages of YAML: In YAML, there is no extra delimiter is used. So it is the lightweight than XML and JSON. YAML, not using delimiter also makes the reading light and simple. (I am not sure if you agree with this point. Because many geeks find it easier to read the data in content delimiter or tags separate those.) YAML makes the data understanding easy. So it is useful in case of configuration. YAML has a wide variety of uses and popular for. It can be used for configuration, then from transferring data to storing intermediate data. YAML is the superset of JSON. You heard it right. Whatever valid JSON code you have, it will be parsed by YAML compiler. So choosing YAML over JSON for your project you have one advantage. You can parse both JSON and YAML code with the single parser (YAML parser). source: https://www.csestack.org/advantages-disadvantages-yaml/
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why shouldn't JSX props use arrow functions or bind?
Using arrow functions or binding in JSX is a bad practice that hurts performance, because the function is recreated on each render. Whenever...
Read more >
No bind or arrow functions in in JSX Props - Maarten Mulders
In its ES6 version, the rule says: “No .bind() or Arrow Functions in JSX Props (react/jsx-no-bind).” The TypeScript version has two rules, ...
Read more >
Is It Necessary to Apply ESLint jsx-no-bind Rule?
When using ESLint React plugin, you may find a rule called jsx-no-bind. It prevents you from using .bind or arrow function in a...
Read more >
Introducing JSX - React
React doesn't require using JSX, but most people find it helpful as a visual aid when working with UI inside the JavaScript code....
Read more >
Performance Engineering with React | by Saif Hakim
No amount of prop checking will help, and your component will always re-render. (You can turn on the react/jsx-no-bind eslint rule to disallow...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found