jsx-eslint/eslint-plugin-react
在 GitHub 查看Create a new rule or update jsx-no-bind to work with react hooks and jsx
Open
#2,901 建立於 2021年1月13日
help wantednew rule
倉庫指標
- Star
- (8,630 star)
- PR 合併指標
- (30 天內沒有已合併 PR)
描述
I am looking for a lint rule that helps me enforce not declaring inline functions (function type is irrelevant) inside jsx code. React hooks don't need binding anymore soo... i'm not sure if including this inside jsx-no-bind would be fair..
React Native basic example below:

This is a something profiling nerds need and I a recommended way of handling functions when jsx is concerned. One possible option available could be to allow one liners to still exist (but i don't see a reason why other than laziness).