question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support for merging `<head>` and `<body>` attrs

See original GitHub issue

At the moment we can’t merge classes, for example:

useHead({
  htmlAttrs: { class: 'first-class' }
})
useHead({
  htmlAttrs: { class: 'second-class' }
})

Sandbox

In this case there will be only one class applied to <html> rather than merging the two, which is what I would expect…

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:12

github_iconTop GitHub Comments

2reactions
theoephraimcommented, Oct 7, 2022

Definitely would be useful. I imagine there are some edge cases where it’s not 100% clear what to do, but if we implement in the most naive way it would probably work for most users, and if it’s opt-in (or could be opt-out) then it should be fine.

Implementing via a new useHtmlAttrs seems like a good idea to not make it breaking.

1reaction
harlan-zwcommented, Nov 14, 2022

This is now in the v1 stable release, attribute props will be merged by default.

You can find documentation here: https://unhead.harlanzw.com/guide/guides/handling-duplicates#tagduplicatestrategy

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Combine A Sculpted Head Mesh And ... - YouTube
This tutorial shows How To Combine A Sculpted Head Mesh And Body Mesh In Blender 2.79.This tutorial teaches how to Bring in a...
Read more >
merge wta-head to jsf-head part one of four - Oracle
Step one of four for merging webtier-alignment HEAD (wta-head) into javaserverfaces-sources HEAD (jsf-head): core code: merge the everything but code that ...
Read more >
HTML Tidy Configuration Options Quick Reference
This option specifies if Tidy should combine styles to generate a single new style, if multiple style values are detected on an element....
Read more >
Merge requests API - GitLab Docs
Supported attributes : ... head_pipeline, object, Pipeline running on the branch HEAD of the merge ... sha, string, Diff head SHA of the...
Read more >
Beautiful Soup Documentation — Beautiful Soup 4.4.0 ...
<html><head></head><body>Sacré bleu!</body></html>. Beautiful Soup then parses the document using the best available parser. It will use an HTML parser ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found