Skip to content

Can't add attributes to ReactInitJavaScript script tag #334

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

Closed
wub opened this issue Oct 11, 2016 · 4 comments
Closed

Can't add attributes to ReactInitJavaScript script tag #334

wub opened this issue Oct 11, 2016 · 4 comments

Comments

@wub
Copy link

wub commented Oct 11, 2016

We'd like to be able to add extra attributes to the ReactInitJavaScript tag:

Current output:
<script>ReactStuff()</script>

Possible desired output:
<script nonce="Fo0/B4r">ReactStuff()</script>

If it's a simple case of adding another parameter to the helper, and adding more to the TagBuilder, I'm happy to take a stab at this.

@Daniel15
Copy link
Member

What's an example of attributes you'd like to add, and for what purpose?

@wub
Copy link
Author

wub commented Oct 11, 2016

Hey @Daniel15, I managed to just reuse some code from inside ReactInitJavaScript and made my own helper. I'll post it here tomorrow when I'm back at work.

I needed to add "nonce" (we're slowly moving to CSP).

Cheers!

@wub wub closed this as completed Oct 11, 2016
@Daniel15
Copy link
Member

I could be wrong, but I don't think "async" would make a difference since it's an inline script.

@wub
Copy link
Author

wub commented Oct 11, 2016

You are not wrong :0)

On 11/10/2016, at 7:20 PM, Daniel Lo Nigro [email protected] wrote:

I could be wrong, but I don't think "async" would make a difference since it's an inline script.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.

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

No branches or pull requests

2 participants