3 ms·
The issue with closures is easily solved, just declare it as class property (or a const variable outside the component if you're using SFC) and then use it inst
by TomMarius 8y ago
The issue with closures is easily solved, just declare it as class property (or a const variable outside the component if you're using SFC) and then use it instead of declaring it inside your render JSX. Any React-aware linter would not let you declare closures in JSX.
- xab9 8y agoCan you recommend a tsx-friendly linter and its setting? The sites I worked with never followed this rule and whenever I tried to bring it up, it was too late to refactor things (at least from a roadmap/burndown po/sm perspective)
- TomMarius 8y agoI use tslint and tslint-react, the rule is named "jsx-no-lambda"