Skip to content

Commit

Permalink
remove underscore from code example
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Apr 20, 2024
1 parent 3c4bcf8 commit 2b51b64
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contributingGuides/STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ Using arrow functions is the preferred way to write an anonymous function such a

```javascript
// Bad
_.map(someArray, function (item) {...});
someArray.map(function (item) {...});

// Good
_.map(someArray, (item) => {...});
someArray.map((item) => {...});
```

Empty functions (noop) should be declare as arrow functions with no whitespace inside. Avoid _.noop()
Expand Down Expand Up @@ -419,7 +419,7 @@ const propTypes = {
### Important Note:
In React Native, one **must not** attempt to falsey-check a string for an inline ternary. Even if it's in curly braces, React Native will try to render it as a `<Text>` node and most likely throw an error about trying to render text outside of a `<Text>` component. Use `_.isEmpty()` instead.
In React Native, one **must not** attempt to falsey-check a string for an inline ternary. Even if it's in curly braces, React Native will try to render it as a `<Text>` node and most likely throw an error about trying to render text outside of a `<Text>` component. Use `.length > 0` instead.
```javascript
// Bad! This will cause a breaking an error on native platforms
Expand All @@ -438,7 +438,7 @@ In React Native, one **must not** attempt to falsey-check a string for an inline
{
return (
<View>
{!_.isEmpty(props.title)
{props.title.length > 0
? <View style={styles.title}>{props.title}</View>
: null}
<View style={styles.body}>This is the body</View>
Expand Down

0 comments on commit 2b51b64

Please sign in to comment.