<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Alisson Leal</title>
    <description>The latest articles on Forem by Alisson Leal (@alissonsleal).</description>
    <link>https://forem.com/alissonsleal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F389883%2Fedcf0cf6-62a3-499d-8a2d-ab3e9fe06e3a.jpg</url>
      <title>Forem: Alisson Leal</title>
      <link>https://forem.com/alissonsleal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/alissonsleal"/>
    <language>en</language>
    <item>
      <title>Como eu uso Github Flow no dia a dia como dev</title>
      <dc:creator>Alisson Leal</dc:creator>
      <pubDate>Thu, 06 Feb 2025 18:24:13 +0000</pubDate>
      <link>https://forem.com/alissonsleal/como-eu-uso-github-flow-no-dia-a-dia-como-dev-80b</link>
      <guid>https://forem.com/alissonsleal/como-eu-uso-github-flow-no-dia-a-dia-como-dev-80b</guid>
      <description>&lt;p&gt;O GitHub Flow é uma metodologia de desenvolvimento que simplifica a colaboração e o controle de versão, promovendo um fluxo de trabalho ágil e eficiente.&lt;/p&gt;

&lt;p&gt;Através do uso estratégico de branches e pull requests, as equipes podem gerenciar o desenvolvimento de novas funcionalidades, correções de bugs e melhorias de forma organizada e previsível.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Visão Geral do GitHub Flow:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Branch Principal (&lt;code&gt;main&lt;/code&gt;):&lt;/strong&gt; Serve como a versão estável do projeto, refletindo o estado de produção.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Feature Branches:&lt;/strong&gt; Para cada nova funcionalidade ou correção, cria-se uma branch específica a partir da &lt;code&gt;main&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commits:&lt;/strong&gt; As alterações são registradas através de commits claros e descritivos na branch correspondente.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pull Requests:&lt;/strong&gt; Após concluir o desenvolvimento ou a correção, abre-se um pull request para revisão e discussão.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Revisão e Merge:&lt;/strong&gt; Após a aprovação, a branch é mesclada de volta na &lt;code&gt;main&lt;/code&gt;, garantindo que apenas código validado seja integrado.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implantação:&lt;/strong&gt; A &lt;code&gt;main&lt;/code&gt; é implantada em produção, garantindo que as últimas alterações aprovadas estejam disponíveis.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Exemplo Prático:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Abaixo, apresentamos um diagrama que ilustra um fluxo de trabalho seguindo o GitHub Flow:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnomb79422y6r62tw5g6b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnomb79422y6r62tw5g6b.png" alt="github flow: https://mermaid.ink/img/pako:eNqVU01PAjEQ_SuTXrhgjMppb6iJB0Niggcleynt7G6hH8u0NRLCf7dlIahhCfQ2M2_evDeTbphwElnBahVeiLdNaSE94YxRAZQsoGQV8lCAsinRklugCCU7C1Ncg8cQlK39ATonbkUDg4y6fR9PX2_u7h8G_bXRoH-EaTUatAFyHAlh_Ph0WpL6LoDLRfQB5rEGZzMU0MrWKXu00aBYuhhOq7tIwcfn7CIFymYoeEGI9vz8kxsI6NP82EoeEHLgD5S9pgxXtksZpBr_m9wTT3a1P6W8rl3z9TK7NfmVhlVEWkOLVDky6cx4YOvEZP59z1vUGipypksGB4Te6S_cQ4WzlVbiSoOjfoOj3wZLy4Ys9adYpu-wyYRp3U06c8lyv-S0zMBtwvEY3HRtBSsCRRyy7h7PitfEDSsqrn3KolTB0aT7X7tvNmQttzPnjhhysW720fYHB9cliQ?type=png" width="800" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Análise do Diagrama:&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Inicialização do Projeto:&lt;/strong&gt; O projeto é iniciado com dois commits na branch &lt;code&gt;main&lt;/code&gt;: "feat: init project" e "feat: initial settings".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Desenvolvimento da Funcionalidade ABC:&lt;/strong&gt; Uma nova branch &lt;code&gt;feat/TASK-123&lt;/code&gt; é criada a partir da &lt;code&gt;main&lt;/code&gt;. Nessa branch, são realizados dois commits: &lt;code&gt;feat: implement feature ABC&lt;/code&gt; e &lt;code&gt;fix: adjust bug on ABC endpoint&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Desenvolvimento da Funcionalidade XYZ:&lt;/strong&gt; Outro desenvolvedor cria uma nova branch, &lt;code&gt;feat/TASK-124&lt;/code&gt;, é criada a partir da &lt;code&gt;main&lt;/code&gt;. Nesta branch, são feitos três commits: &lt;code&gt;feat: implement feature XYZ&lt;/code&gt;, &lt;code&gt;fix: adjust bug in XYZ screen&lt;/code&gt; e &lt;code&gt;test: update tests in XYZ endpoint&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integração das Funcionalidades:&lt;/strong&gt; Após o desenvolvimento e testes, as branches de funcionalidades são &lt;del&gt;mergeadas&lt;/del&gt; mescladas de volta na &lt;code&gt;main&lt;/code&gt; através de pull requests.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Benefícios do GitHub Flow:&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simplicidade:&lt;/strong&gt; Um fluxo de trabalho linear e fácil de seguir.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integração Contínua:&lt;/strong&gt; Facilita a integração contínua de código, reduzindo conflitos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Colaboração Eficiente:&lt;/strong&gt; Uso de pull requests para revisão e discussão de código.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Desenvolvimento Ágil:&lt;/strong&gt; Permite iterações rápidas e entrega contínua de valor.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ao adotar o GitHub Flow, as equipes de desenvolvimento podem manter um processo organizado e eficiente, garantindo a qualidade e a estabilidade do código em produção.&lt;/p&gt;

&lt;p&gt;Fontes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.github.com/en/get-started/using-github/github-flow" rel="noopener noreferrer"&gt;https://docs.github.com/en/get-started/using-github/github-flow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Experiência prática de desenvolvimento de software.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to separate your work and personal commits in git (Fix and prevent)</title>
      <dc:creator>Alisson Leal</dc:creator>
      <pubDate>Thu, 21 Apr 2022 17:35:24 +0000</pubDate>
      <link>https://forem.com/alissonsleal/how-to-separate-your-work-and-personal-commits-in-git-fix-and-prevent-4edo</link>
      <guid>https://forem.com/alissonsleal/how-to-separate-your-work-and-personal-commits-in-git-fix-and-prevent-4edo</guid>
      <description>&lt;p&gt;You're a developer and you want to separate your work from your personal commits. You want to make sure that you don't accidentally commit to work using your personal email, or even worse, commit to an open source project using your work email.&lt;/p&gt;

&lt;p&gt;Surely you know you can use &lt;code&gt;git config user.name "Your Name"&lt;/code&gt; and &lt;code&gt;git config user.email "your@email.com"&lt;/code&gt; to set your name and email for each project, but that gets tedious and error-prone if you work on a lot of repositories, I'm looking at your microservices each on their own repository and not on a mono-repo.&lt;/p&gt;

&lt;p&gt;To fix this is actually very simple.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fixing wrong email/name in commits
&lt;/h2&gt;

&lt;p&gt;Just run this command in your terminal inside the repository folder, changing the variable &lt;code&gt;WRONG_EMAIL&lt;/code&gt; to your wrong email, &lt;code&gt;NEW_NAME&lt;/code&gt; to your new name and &lt;code&gt;NEW_EMAIL&lt;/code&gt; to your new email.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;This only fixes past problems, below this is a more general solution to prevent future problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preventing wrong email/name in commits
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Create a work and a personal folder
&lt;/h3&gt;

&lt;p&gt;You must separate your work and personal projects in different folders, I for example have my work folder &lt;code&gt;~/work&lt;/code&gt; and my personal folder &lt;code&gt;~/personal&lt;/code&gt;. All the repositories that I work on are in the &lt;code&gt;~/work&lt;/code&gt; folder. All the repositories that are personal to me are in the &lt;code&gt;~/personal&lt;/code&gt; folder.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a gitconfig for each folder
&lt;/h3&gt;

&lt;p&gt;Create a &lt;code&gt;gitconfig&lt;/code&gt; file in both folders. The file must contain the following lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# ~/work/gitconfig&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;user]
  name &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Your Work Name"&lt;/span&gt;
  email &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"your@work.email"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# ~/personal/gitconfig&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;user]
  name &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Your Personal Name"&lt;/span&gt;
  email &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"your@personal.email"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Setup your global .gitconfig
&lt;/h3&gt;

&lt;p&gt;You probably already have a &lt;code&gt;.gitconfig&lt;/code&gt; file in your home folder, but if you don't, just create one in the root of your home folder.&lt;br&gt;
It probably contains the following lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;user]
  name &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;
  &lt;span class="c"&gt;# add your email if you will clone a repository in other folders other than your work or personal folder&lt;/span&gt;
  email &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"your@default.email"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To finish the setup, just add the following lines to your &lt;code&gt;.gitconfig&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# for your work repositories&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;includeIf &lt;span class="s2"&gt;"gitdir:~/work/**"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  path &lt;span class="o"&gt;=&lt;/span&gt; ~/work/gitconfig

&lt;span class="c"&gt;# for your personal repositories&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;includeIf &lt;span class="s2"&gt;"gitdir:~/personal/**"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  path &lt;span class="o"&gt;=&lt;/span&gt; ~/personal/gitconfig
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  How it works
&lt;/h3&gt;

&lt;p&gt;When you clone a repository, the &lt;code&gt;.gitconfig&lt;/code&gt; file in the root of the repository is read. If the repository is in your work folder, the &lt;code&gt;gitconfig&lt;/code&gt; file in the work folder is read. If the repository is in your personal folder, the &lt;code&gt;gitconfig&lt;/code&gt; file in the personal folder is read. The best part is if you have different ssh keys for your work and personal git, you can use setup them in each &lt;code&gt;gitconfig&lt;/code&gt; file, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# ~/personal/gitconfig&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;core]
    sshCommand &lt;span class="o"&gt;=&lt;/span&gt; ssh &lt;span class="nt"&gt;-i&lt;/span&gt; ~/.ssh/personal
&lt;span class="o"&gt;[&lt;/span&gt;user]
  name &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Your Personal Name"&lt;/span&gt;
  email &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"your@personal.email"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# ~/work/gitconfig&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;core]
    sshCommand &lt;span class="o"&gt;=&lt;/span&gt; ssh &lt;span class="nt"&gt;-i&lt;/span&gt; ~/.ssh/work
&lt;span class="o"&gt;[&lt;/span&gt;user]
  name &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Your Work Name"&lt;/span&gt;
  email &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"your@work.email"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it!&lt;/p&gt;

&lt;p&gt;Sources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;man git config&lt;/code&gt; inside the &lt;code&gt;includes&lt;/code&gt; part

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.git-scm.com/docs/git-config#_includes" rel="noopener noreferrer"&gt;https://www.git-scm.com/docs/git-config#_includes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://meleu.sh/git-multiconfig/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://meleu.sh/git-multiconfig/" rel="noopener noreferrer"&gt;https://meleu.sh/git-multiconfig/&lt;/a&gt; in pt-br&lt;/li&gt;

&lt;li&gt;
&lt;a href="https://www.git-tower.com/learn/git/faq/change-author-name-email/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://www.git-tower.com/learn/git/faq/change-author-name-email/" rel="noopener noreferrer"&gt;https://www.git-tower.com/learn/git/faq/change-author-name-email/&lt;/a&gt;
&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;If you wanna check out what I'm currently working on: &lt;a href="https://brapi.dev" rel="noopener noreferrer"&gt;brapi.dev&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Type-Safe Styled-Components Theming for React.js and Next.js 💅</title>
      <dc:creator>Alisson Leal</dc:creator>
      <pubDate>Mon, 20 Dec 2021 13:25:31 +0000</pubDate>
      <link>https://forem.com/alissonsleal/type-safe-styled-components-theming-for-reactjs-and-nextjs-2fhe</link>
      <guid>https://forem.com/alissonsleal/type-safe-styled-components-theming-for-reactjs-and-nextjs-2fhe</guid>
      <description>&lt;p&gt;We all know and love styled-components and Typescript, but when a library is not typed, it can be difficult to use and seem very hacky. You can and should add the types from &lt;code&gt;@types/styled-components&lt;/code&gt; but it doesn't seem to work very well with custom themes. This post will help you with that.&lt;/p&gt;

&lt;p&gt;If you tried using styled-components with custom theming, you must've had errors like this:&lt;br&gt;
&lt;code&gt;Styled-Components-Typescript: Property 'backgroundColor' does not exist on type 'DefaultTheme'&lt;/code&gt;, which is a very common error if you're using a custom theme with Typescript and apparently &lt;a href="https://github.com/styled-components/styled-components/issues/3569#issuecomment-905646552" rel="noopener noreferrer"&gt;they don't maintain the types&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There are at least two solutions to this problem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The official way, which is very manual&lt;/li&gt;
&lt;li&gt;The easy way, which everything works automatically&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  The official way (Very manual)
&lt;/h2&gt;

&lt;p&gt;If you go to the &lt;a href="https://styled-components.com/docs/api#typescript" rel="noopener noreferrer"&gt;styled-components documentation&lt;/a&gt;, you'll see a super small section about Typescript in there, which is fine until you need to make a lot of changes to your theme.&lt;/p&gt;

&lt;p&gt;The way it's done in the official documentation to make your theme type-safe is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a declarations file (&lt;code&gt;styled.d.ts&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Import the DefaultTheme from styled-components&lt;/li&gt;
&lt;li&gt;Extend it with your custom theme&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// import original module declarations&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// and extend them!&lt;/span&gt;
&lt;span class="kr"&gt;declare&lt;/span&gt; &lt;span class="kr"&gt;module&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;DefaultTheme&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;borderRadius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nl"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;main&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nl"&gt;secondary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// source: https://styled-components.com/docs/api#create-a-declarations-file&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then you create a custom theme and reference the DefaultTheme interface you just created, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// myTheme.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;DefaultTheme&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;myTheme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;DefaultTheme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;borderRadius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;5px&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

  &lt;span class="na"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;main&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cyan&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;secondary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;magenta&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;myTheme&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// source: https://styled-components.com/docs/api#create-a-theme&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works fine, the problem is that everytime you need to add/remove something from your theme, you'll need to also update the declarations file.&lt;/p&gt;

&lt;h2&gt;
  
  
  The easy way (very automatic)
&lt;/h2&gt;

&lt;p&gt;The way I do is to just create a custom theme file and then automatically create an interface for it. This way you don't need to update the declarations file everytime you add something to your theme.&lt;/p&gt;

&lt;p&gt;The steps are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a custom theme file&lt;/li&gt;
&lt;li&gt;Create a declarations file (&lt;code&gt;styled.d.ts&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Create your theme
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// myTheme.ts&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;myTheme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;borderRadius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;5px&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

  &lt;span class="na"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;main&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cyan&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;secondary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;magenta&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Create the declarations file
&lt;/h3&gt;

&lt;p&gt;Here's the fun part. When you create the declarations file, you'll need to import the DefaultTheme from styled-components like before, but instead of creating a new interface, you'll just extend the type of your theme (&lt;code&gt;myTheme&lt;/code&gt;) with the DefaultTheme.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// styled.d.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;myTheme&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./theme&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kr"&gt;declare&lt;/span&gt; &lt;span class="kr"&gt;module&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;MyTheme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;myTheme&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;DefaultTheme&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;MyTheme&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I know it's not the most elegant way to do it, but it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using the theme
&lt;/h2&gt;

&lt;p&gt;I know it's not the purpose of this post to explain how to create and use the theme, but I'll do it anyway.&lt;/p&gt;

&lt;p&gt;You're probably using React.js, so you have an &lt;code&gt;App.tsx&lt;/code&gt; or &lt;code&gt;_app.jsx&lt;/code&gt; in Next.js. In that file you just need to create a &lt;code&gt;ThemeProvider&lt;/code&gt; and pass your theme to it. Something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// With React.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ThemeProvider&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;myTheme&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./theme&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ThemeProvider&lt;/span&gt; &lt;span class="na"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;myTheme&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hello World!&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;ThemeProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And for Next.js people, you just need to change a little bit the default &lt;code&gt;_app.tsx&lt;/code&gt; file they give you.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// With Next.js&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ThemeProvider&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AppProps&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;next/app&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;myTheme&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./theme&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;MyApp&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pageProps&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt; &lt;span class="nx"&gt;AppProps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;ThemeProvider&lt;/span&gt; &lt;span class="na"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;myTheme&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Component&lt;/span&gt; &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;pageProps&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;ThemeProvider&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With that done, you can easily access your theme in your components.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Box.tsx&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;BoxContainer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="s2"&gt;`
  display: flex;
  border-radius: &lt;/span&gt;&lt;span class="p"&gt;${(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;borderRadius&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;;
  color: &lt;/span&gt;&lt;span class="p"&gt;${(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;;
  background-color: &lt;/span&gt;&lt;span class="p"&gt;${(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;secondary&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Box&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;BoxContainer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hello World!&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;BoxContainer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or a more direct approach with object destructuring:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Box.tsx&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;styled-components&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;BoxContainer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styled&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="s2"&gt;`
  display: flex;
  border-radius: &lt;/span&gt;&lt;span class="p"&gt;${({&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;borderRadius&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;;
  color: &lt;/span&gt;&lt;span class="p"&gt;${({&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;;
  background-color: &lt;/span&gt;&lt;span class="p"&gt;${({&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;secondary&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Box&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;BoxContainer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hello World!&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;BoxContainer&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here you can see the autocompletion of the theme in your components without the need to update the declarations file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7y8t0wdh7jmmf1et03du.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7y8t0wdh7jmmf1et03du.gif" alt="Theme autocompletion" width="647" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope this post helped you with your styled-components and typescript problems. If you have any questions, please don't hesitate to ask me in the comments. I'm always happy to help.&lt;/p&gt;

&lt;p&gt;If you wanna check out what I'm currently working on: &lt;a href="https://brapi.dev" rel="noopener noreferrer"&gt;brapi.dev&lt;/a&gt;&lt;/p&gt;

</description>
      <category>styledcomponents</category>
      <category>typescript</category>
      <category>react</category>
      <category>nextjs</category>
    </item>
  </channel>
</rss>
