Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
feat(yellowbox): Use YellowBox with Expo -- fixes #367 (#368 by @nona…
Browse files Browse the repository at this point in the history
…meolsson)

[skip ci]
  • Loading branch information
nonameolsson authored Sep 24, 2020
1 parent 7afe6b0 commit fb03e55
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@
* Ignore some yellowbox warnings. Some of these are for deprecated functions
* that we haven't gotten around to replacing yet.
*/
<% if (props.useExpo) { -%>
import { YellowBox } from "react-native"
// prettier-ignore
YellowBox.ignoreWarnings([
"Require cycle:",
])
<% } else { -%>
import { LogBox } from "react-native"
// prettier-ignore
LogBox.ignoreLogs([
"Require cycle:",
])
<% } -%>
4 changes: 4 additions & 0 deletions boilerplate/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@
"@types/jest": "^25.2.3",
"@types/ramda": "0.26.44",
"@types/react": "16.9.23",
<% if (props.useExpo) { -%>
"@types/react-native": "0.61.23",
<% } else { -%>
"@types/react-native": "^0.63.2",
<% } -%>
"@types/react-test-renderer": "^16.9.2",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
Expand Down
1 change: 1 addition & 0 deletions src/boilerplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ And here: https://guides.cocoapods.org/using/getting-started.html
template: "app/services/reactotron/reactotron.ts.ejs",
target: "app/services/reactotron/reactotron.ts",
},
{ template: "app/utils/ignore-warnings.ts.ejs", target: "app/utils/ignore-warnings.ts" },
{ template: "app/utils/storage/storage.ts.ejs", target: "app/utils/storage/storage.ts" },
{
template: "app/utils/storage/storage.test.ts.ejs",
Expand Down

0 comments on commit fb03e55

Please sign in to comment.