Skip to content

Commit e20019b

Browse files
committed
Add doc about <Broadcast compareValues>
1 parent 2680fb2 commit e20019b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ class App extends React.Component {
100100
}
101101
```
102102

103+
By default `<Broadcast value>` values are compared using the `===` (strict equality) operator. To
104+
change this behavior, use `<Broadcast compareValues>` which is a function that takes the `prevValue`
105+
and `nextValue` and compares them. If `compareValues` returns `true`, no re-render will occur.
106+
103107
You may prefer to wrap these components into channel-specific pairs to avoid typos and other
104108
problems with the indirection involved with the channel strings:
105109

0 commit comments

Comments
 (0)