Support JSON/Objects in Escaped Template Parts
See original GitHub issueThe scenario I’m talking about is:
const Title = styled("h1")`
font-weight: bold;
${p => ({ color: "dodgerblue" })};
`;
As far as I can tell this just gets serialized to [Object object]
. This was brought to my attention due to someone trying to use Styled System(https://github.com/styled-system/styled-system) with Goober which works this way apparently. It lets developers replace common transformations with premade functions. Cool in concept at least.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
JSONObject contains escape characters - java - Stack Overflow
JSONObject is correctly encoding the string. This page describes how string literals are to be escaped in JavaScript (and, by extension, JSON).
Read more >Escape characters within JSON object not working - ServiceNow
I've tried escaping the escape with "\\n". The same issue is occurring when updating an Alert manually through a glide record object.
Read more >Multiple problems parsing JSON, escaping, encoding ... - GitHub
This is problematic for un-escaping a JSON string because it lacks support for the \uXXXX escape, converting the \u to a u ....
Read more >Introduction to JSON-Java (org.json) - Baeldung
Learn ways to escape a JSON String core Java or a library ... For the complete list of methods supported by JSONObject, visit...
Read more >JSON - JavaScript - MDN Web Docs
The JSON object contains methods for parsing JavaScript Object Notation (JSON) and converting values to JSON. It can't be called or constructed.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alrighty! Due to popular demand and low footprint in size, this is working for tagged templates as well. Available in
2.0.9
. Thanks for reaching out and pursue this! Much appreciate it!Thanks @cristianbote, I guess it can be used as a workaround. Maybe, I’ll have a look to see what is needed to get it working with tagged templates.
Cheers 👍🏼