React-helmet: IE conditional comments

Created on 3 Jan 2019  路  3Comments  路  Source: nfl/react-helmet

Is there any way to add IE conditional comments to <head> tag?

Most helpful comment

idk if this'll help but
https://blog.logrocket.com/conditional-rendering-in-react-c6b0e5af381e

Actually the problem is that I want to add something like this to the head in SSR:

<!--[if lt IE 9]>
<script type="text/javascript" src="..."></script>
<![endif]-->

But I can't just add a comment inside Helmet tag to add it to head :(

All 3 comments

idk if this'll help but
https://blog.logrocket.com/conditional-rendering-in-react-c6b0e5af381e

and if you meant internet explorer you can use this
if (navigator.userAgent.indexOf('Trident') > -1) {
//do stuff
}

idk if this'll help but
https://blog.logrocket.com/conditional-rendering-in-react-c6b0e5af381e

Actually the problem is that I want to add something like this to the head in SSR:

<!--[if lt IE 9]>
<script type="text/javascript" src="..."></script>
<![endif]-->

But I can't just add a comment inside Helmet tag to add it to head :(

I have the same issue than you @tiagonapoli and no solution 馃槩 Maybe it's an issue with React.

Was this page helpful?
0 / 5 - 0 ratings