Introduction
Building a Todo application is a logical way to delve into the world of modern web development. In this guide, we’ll focus on the pivotal index file of your Todo app, exploring how to construct it using a powerful tech stack: GatsbyJS, TypeScript, ReactJS, Recoil, and Chakra-UI.
Click here to find out what you will be building.
Now, let’s dive in! 🤿
Create a Gatsby Site:
npm install -g gatsby-cli
gatsby new todo-app
cd todo-app
Install Dependencies
You will need the following dependencies installed:
npm install gatsby react react-dom @chakra-ui/react @emotion/react @emotion/styled recoil
Configure the Index File
Navigate to src/pages/index.tsx and set up your index file like so:
import * as React from 'react';
import { RecoilRoot } from 'recoil';
import { ChakraProvider } from '@chakra-ui/react';
import { render } from 'react-dom';
import ContentPage from '../content-apps/to-do';
const Root = () => (
<RecoilRoot>
<ChakraProvider>
<ContentPage />
</ChakraProvider>
</RecoilRoot>
);
render(<Root />, document.getElementById('root'));
And Inside The ContentPage Component
You will need the following code placed inside the src/content-apps/to-do/index.tsx file:
import React from 'react';
// local components
import TodoList from './components/to-do-list';
const ContentRecoilToDo = () => {
return <TodoList />;
};
export default ContentRecoilToDo;
What Now?
Ah, you’ll have to wait for the next exciting installment dear coder.
Thank you for reading thus far.
Happy coding and creating! 🌟🎉
#GatsbyJS #TypeScript #ReactJS #Recoil #ChakraUI #TodoApp #FrontendDev #WebDev #CodingTips
Photo by Thomas Bormans on Unsplash