Skip to content

Commit

Permalink
document jsx-no-bind local function declaration behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
p7g committed Aug 24, 2021
1 parent bcb2a88 commit 08132d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/rules/jsx-no-bind.md
Expand Up @@ -14,6 +14,10 @@ Examples of **incorrect** code for this rule:
```jsx
<Foo onClick={() => console.log('Hello!')}></Foo>
```
```jsx
function onClick() { console.log('Hello!'); }
<Foo onClick={onClick} />
```

Examples of **correct** code for this rule:
```jsx
Expand Down Expand Up @@ -76,6 +80,11 @@ Examples of **correct** code for this rule, when `allowFunctions` is `true`:
<Foo onClick={function () { alert("1337") }} />
```
```jsx
function onClick() { alert("1337"); }
<Foo onClick={onClick} />
```
### `allowBind`
Examples of **correct** code for this rule, when `allowBind` is `true`:
Expand Down

0 comments on commit 08132d4

Please sign in to comment.