Skip to content

Commit

Permalink
Tm/feature/react guidelines (#819)
Browse files Browse the repository at this point in the history
Update rule
  • Loading branch information
arhtudormorar authored Apr 16, 2024
1 parent 3b3979d commit 0f373c8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions docs/developers/guidelines/react-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,19 @@ function printUser({ name, age }) {
```

There are exceptions to this rule like:
1. There is a name clash with variables defined above
1. The arguments are optional

```jsx
function logWithOptions(options?: {green?: boolean}) {
if (options?.green) {
return console.log('\x1b[42m%s\x1b[0m', 'Some green text');
}
console.log('Some normal text');
}
```

2. There is a name clash with variables defined above

```jsx
const type = 'admin';
Expand All @@ -305,7 +317,7 @@ function verifyUser(user) {
}
```
2. Same props are passed below to a component, or are used for further processing
3. Same props are passed below to a component, or are used for further processing

```jsx
// 🚫 DON'T
Expand Down

0 comments on commit 0f373c8

Please sign in to comment.