Hacker News new | ask | show | jobs
by samb1729 1996 days ago
It is not clear how this response is meant to answer the question in the post you replied to; there was no mention of whitespace.

Their question was:

>Why is there a string right after the field "button" of the object "styled"?

which unambiguously refers to the double backtick characters between "styled.button" and the semicolon in this expression:

> export const Button = styled.button``;

That is, in JavaScript, an empty string. There is not whitespace and Python has nothing at all to do with the question. Similarly, an explanation of what a semicolon does in JavaScript does not answer the question.

I also can't answer the question for them as I haven't kept up with newer JavaScript standards, but I thought it important that you realise you misunderstood something here.

1 comments

Possibly a HN formatting issue (or the commenter typed wrong first time and later edited) but the backticks weren't showing up previously.

Sorry @Traubenfuchs for the misguided explanation.

As another commenter posted, this is a template tag. Technically equivalent to doing something like styled.button('') but the template tag syntax would be used for consistency with other calls in the code (where parameterised template strings would be passed to the button/element/component method)