File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,11 @@ export const CookieConsentContextWrapper: React.FC<PropsWithChildren<{ visibleBy
13
13
children,
14
14
visibleByDefault
15
15
} ) {
16
- const [ visible , setVisible ] = useState ( ( ) =>
17
- typeof visibleByDefault == 'boolean' ? visibleByDefault : ! hasUserDecidedOnConsent ( )
16
+ const [ visible , setVisible ] = useState ( ( ) => {
17
+ console . log ( visibleByDefault )
18
+ console . log ( ! hasUserDecidedOnConsent ( ) )
19
+ return typeof visibleByDefault == 'boolean' ? visibleByDefault : ! hasUserDecidedOnConsent ( )
20
+ }
18
21
)
19
22
return (
20
23
< CookieConsentContext . Provider value = { { visibleByDefault : visible , setVisibleByDefault : setVisible } } >
@@ -42,11 +45,12 @@ export const ContextualCookieConsent: React.FC<Partial<CookieConsentProps>> = pr
42
45
const configuration = useCookieConsentContext ( )
43
46
44
47
useEffect ( ( ) => {
48
+ console . log ( configuration )
45
49
setIsClient ( true )
46
50
} , [ ] )
47
51
48
52
49
53
const Component = configuration . visibleByDefault ? VisibleCookieConsent : CookieConsent
50
54
51
- return isClient ? < Component { ...props } /> : < CookieConsent { ...props } />
55
+ return isClient ? < Component { ...props } /> : < CookieConsent { ...props } />
52
56
}
You can’t perform that action at this time.
0 commit comments