Skip to content

Instantly share code, notes, and snippets.

@franklinjavier
Last active February 14, 2019 19:00
Show Gist options
  • Save franklinjavier/535f602f0129b79c6122daf188e6c29d to your computer and use it in GitHub Desktop.
Save franklinjavier/535f602f0129b79c6122daf188e6c29d to your computer and use it in GitHub Desktop.
// Errado
// Não queria criar uma tag span desnecessariamente
<ProductName>
<a href={`${baseUrl}/${product.slugName}`} >
<strong dangerouslySetInnerHTML={{__html: product.brand.name}} />{' '}
<span dangerouslySetInnerHTML={{__html: product.name}} />
</a>
</ProductName>
// Correto
<ProductName>
<a href={`${baseUrl}/${product.slugName}`} >
<strong dangerouslySetInnerHTML={{__html: product.brand.name}} />{' '}
{dangerouslySetInnerHTML(product.name)}
</a>
</ProductName>
--edit
agora daria pra usar <Fragment>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment