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.

Syntax highlighting broken with typescript type literals and with simple elements like styled.div

See original GitHub issue

screen shot 2019-03-04 at 10 37 53

#26 only added partial typescript support:

const StyledSection = styled.div<{ backgroundColor?: string }>` // no highlighting
const StyledSection = styled.div<Props>` // no highlighting
const StyledSection = styled<{ backgroundColor?: string }>('div')` // no highlighting
const StyledSection = styled<Props>('div')` // works

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:34
  • Comments:33

github_iconTop GitHub Comments

18reactions
mrGibicommented, Mar 26, 2019

to all: its finally fixed with 0.0.26 released today 🎉

9reactions
willem-aartcommented, Jan 13, 2020

It seems this does work with styled, but not with createGlobalStyle<>.

Same for css<..>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Syntax highlighting broken with typescript type literals ...
Syntax highlighting broken with typescript type literals and with simple elements like styled.div.
Read more >
Tooling - styled-components
This plugin transpiles styled-components tagged template literals down to a smaller representation than what Babel normally creates. Wait, transpiling tagged ...
Read more >
Using styled-components with props and TypeScript
1) and styled-components (eg. 3.4.5) there's no need for a separate helper. You can specify the interface/type of your props to styled- ...
Read more >
The starting point for learning TypeScript
Cheat Sheets. Downloadable syntax reference pages for different parts of everyday TypeScript code. Control Flow Analysis · Classes · Interfaces · Types ......
Read more >
Using styled-components in TypeScript: A tutorial with examples
This installs the styled-components types for TypeScript as a dev ... styled gives us the option to use any HTML element, such as...
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