SX Prop can use React Context State? #1761
Unanswered
tarikmiljkovic
asked this question in
Q&A
Replies: 1 comment
-
@tarikmiljkovic sure, I'm using something along these lines all the time // dummy code
const MyComponent = () => {
const { primaryNav } = useMyContext()
return (
<Box sx={{
variant: "styles.headnavlink",
color: primaryNav ? 'white' : 'black',
p: 2,
}} />
)
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello All,
does anybody know, can sx props use a state from React Context like in this example?
primaryNav is a state.
Thank you a lot
Beta Was this translation helpful? Give feedback.
All reactions