Introduction
If you're like me, you've heard a lot about Tailwind CSS but you've never actually tried it out. That's about to change though. Join me in this blog series as I learn Tailwind CSS as we attempt to build reusable components within a React project (specifically, NextJs). Mistakes will be made, tears will be shed as we struggle to get things to look as we want, however hopefully by the end of each post both you and I have learned something new.
A quick note about this blog series, it isn't about Next, however I'll be using it throughout the blogs. Don't worry if you've never used React or Next, you should still be able to follow along and you never know... you may learn some extra things in the process! If you'd like a quick intro to Next I'd recommend giving the following video by Fireship a quick watch.
Creating Our Project
Extra: TypeScript Configuration
I'm a fan of TypeScript and so have configured my Next project to use TypeScript, if you're looking to do the same then this section is for you. TypeScript was ranked as the second most loved language by developers in the 2020 Stack Overflow survey so chances are you'll enjoy using it too. If you're not interested in using TypeScript over JavaScript ( although I'm not sure why that would be the case ) then you can just ignore this section and continue on using JavaScript as you follow along, it shouldn't make much difference to your experience for the most part anyway for what we'll be doing.
tsconfig.json
Dependency Installation
Converting Files To TypeScript & Adding Types
Now you'll need to change the extensions on some of the files contained within your pages directory.yarn dev
command you should see the same output as before on your browser when
you connect to localhost:3000
Comments
Post a Comment