We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a0a717 commit 7839b26Copy full SHA for 7839b26
src/context.tsx
@@ -1,4 +1,5 @@
1
import React, { createContext, useContext, useRef } from 'react'
2
+import { ViewStyle } from 'react-native'
3
4
import {
5
Breakpoints,
@@ -65,14 +66,11 @@ export const useBreakpoint = () => {
65
66
67
export const useDebugStyle = () => {
68
const { debug } = useStacks()
69
+ const stylesRef = useRef<ViewStyle>()
70
- if (!debug) {
- return undefined
71
- }
+ stylesRef.current = debug ? { backgroundColor: randomColor() } : undefined
72
73
- const backgroundColorRef = useRef(randomColor())
74
-
75
- return { backgroundColor: backgroundColorRef.current }
+ return stylesRef.current
76
}
77
78
export const StacksProvider = (props: Props) => {
0 commit comments