Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass in nonce to emotion (Experiment) #8

Open
wants to merge 1 commit into
base: text
Choose a base branch
from
Open

Conversation

asabhaney
Copy link
Member

@asabhaney asabhaney commented Nov 20, 2018

There's 2 good ways to go about this. One is illustrated in this PR, but another alternative is to pass in a custom emotion instance prop, which might actually be better, as we won't have to keep changing the lib code if the create-emotion api ever changes.

// In app code
const emotion = createEmotion({ nonce: 'whatevs' })

return (
   <OIO combineCssFn={emotion.cx} cssInJsFn={emotion.css}>
       <Text>Yay! A little more secure</Text>
   </OIO>
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant