Skip to content

Commit 10ae5a7

Browse files
orb(reactotron): Update docs to explain current trackGlobalErrors veto behavior (#1586)
## Please verify the following: - [ ] yarn run v1.22.22 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. passes - [ ] I have added tests for any new features, if relevant - [ ] (or relevant documentation) has been updated with your changes ## Describe your PR Updates docs to match existing behavior ~~The docs state that this function should return true to skip the frame, and false to keep it, but that is opposite existing behavior.~~ ~~This commit fixes the veto function to behave as expected~~ (b0a4fb3fd61136d149eb3ab6c75c4ef3dd1052c9)
1 parent ccb81aa commit 10ae5a7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

docs/reactotron/plugins/track-global-errors.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ Reactotron.configure()
4040
.use(
4141
trackGlobalErrors({
4242
veto: (frame) =>
43-
frame.fileName.indexOf("/node_modules/react-native/") >= 0,
43+
!frame.fileName.includes("/node_modules/react-native/"),
4444
})
4545
)
4646
.connect();
4747
```
4848

49-
`veto` is a function that takes an `object` and returns a `boolean`. `true` = ditch it. `false` = keep it.
49+
`veto` is a function that takes an `object` and returns a `boolean`. `true` = keep it. `false` = ditch it.
50+
51+
> **Note:** This behavior is inverted from the originally intended design. The function was meant to work as "true = ditch it, false = keep it", but due to a long-standing implementation detail (using `.filter()` which keeps truthy values), the actual behavior has been the opposite. Since this behavior has existed for so long, it's now considered the expected behavior and the documentation has been updated to reflect it.
5052
5153
The frame object passed into `veto` has these properties.
5254

0 commit comments

Comments
 (0)