DEV Community

Discussion on: Styled-components 3 ways

Collapse
 
pcjmfranken profile image
Peter Franken

Ran into quite a few issues and limitations sadly.

The css interpolation function is still required if you want to execute logic statements or curried functions. Slightly more info in the official docs: styled-components.com/docs/api#css

Also the syntax highlighting breaks if you place the opening backtick that comes after (props) => on a new line. Unfortunately Prettier automatically places the entire inner interpolation function on its own line grrr 😝

Thread Thread
 
stereobooster profile image
stereobooster • Edited

The css interpolation function is still required if you want to execute logic statements or curried functions.

simple template literal (without css):

`logic statement: ${prop === 1 ? "one" : "many"}
function: ${fun(prop)}`
Enter fullscreen mode Exit fullscreen mode

Sadly, but yes highlighting is broken in many cases