The reason why we can use the latter one i.e component name, is because we have imported a component here that is Link, now we can pass this Link like this: styled together with 'tagNames' (e.g div or li or h1 etc) or a valid component name can be used to apply styles to a component. If you are familiar with styled components, you should know that styled is like the very basic thing you import from styled-components. METHOD 2: Styling links using 'ponentName' format. Here is a Codesandbox link if you are interesting in taking a quick glance at the code for METHOD-1 and if you wish you can follow along too. These basically are similar to how we use inline styles in HTML.So we create a style attribute with the styles inside it in an object form.Ĭonclusion : This is not so great way as it will become difficult to code out and track individual styles as the app scales - Also, it does not meet the standards of our Goals stated at the beginning of the article. Enter fullscreen mode Exit fullscreen mode
0 Comments
Leave a Reply. |