Amirprogrammer
2 min readFeb 5, 2021

--

1 tip for clean code

take a brief look at the pages
And in similar places , Instead of coding several times, make a component

Hello guys
One of the most important features that React provides to its programmers
is the reusable component 
Whenever you feel that a piece of code
is running several times
Just make it a component
And call the created component several times
And it helps a lot to keep your code clean
One of the things that must be done first
in any project, is to take a brief look at the pages
And in similar places , Instead of coding several times, make a component and use it several times
.
For example, on the next slide, I put the headers of several pages of an application
I made numbers one, two, and three a component
I also made a component for numbers 5 and 6
And in number 4, number 1 is called
.
In the next post, I will tell you a way to convert a
few similar components
But different in a series of details to a component

Categorize component

--

--