Bluesky app fork with some witchin' additions 馃挮
witchsky.app
bluesky
fork
client
1import 'array.prototype.findlast/auto'
2import 'setimmediate'
3
4if (process.env.NODE_ENV !== 'production') {
5 // In development, react-native-web's <View> tries to validate that
6 // text is wrapped into <Text>. It doesn't catch all cases but is useful.
7 // Unfortunately, it only does that via console.error so it's easy to miss.
8 // This is a hack to get it showing as a redbox on the web so we catch it early.
9 const realConsoleError = console.error
10 const thrownErrors = new WeakSet()
11 console.error = function consoleErrorWrapper(msgOrError) {
12 if (
13 typeof msgOrError === 'string' &&
14 msgOrError.startsWith('Unexpected text node')
15 ) {
16 if (
17 msgOrError ===
18 'Unexpected text node: . A text node cannot be a child of a <View>.'
19 ) {
20 // This is due to a stray empty string.
21 // React already handles this fine, so RNW warning is a false positive. Ignore.
22 return
23 }
24 const err = new Error(msgOrError)
25 thrownErrors.add(err)
26 throw err
27 } else if (!thrownErrors.has(msgOrError)) {
28 return realConsoleError.apply(this, arguments as any)
29 }
30 }
31}
32
33export {}