In this React eCommerce website, we are going to learn how to clear the filters in React JS. This will help us to categorize our products more effectively on our eCommerce website.
Tell me how today's weather is very humid
No it's very today because today we want to see
Clear Filters In or Reactive Commerce Website
What does that mean
This means that you can see it
We have seen everything
Only one filter remains and this is the clear filter
Let's just have a laptop
And I didn't find it fun at all
I want to see everything at once
You have probably seen this many times
In Amazon in Flipkart you can
pick any e-commerce website
You have put a lot of filters on there
We work together I need the
Samsung company not Apple Samsung
Black color is not available
okay this one is in black color
Okay the price is a bit low
Less than 60 so many of them
You have been filtered now me
Nothing is left now I have to go
All products in one look then guys let me go first
This all then this
Something has to be done doesn't it
But what can I do now so muc
Izili if so many
If you have selected filters
I'll refresh to reset everyone
And everything was reset
The more filters there were all of them were their own
So that's what we're going to see in this video and let me tell you
It will be very fun and our one type of
It will be completed then we we our
This is what will work on add to cart okay
Okay guys let's see I'm going to go over here
It's very simple bu
So what is that button it's okay so far we have
What was SIP doing making a function call that is
Update filter value for each one were doing the same thing
But I can't do that anymore
so I'm pressing a different button
And why am I getting a warning I'll tell you
That is the button which is not defined
These are the譬 elements I am on top
I walk and I do this which is mine
The button is I import it this
I think it will be
inside our styles so we have
a button from styles
This is the inside button yes
It means that we have to do something
Class will have to be added
so the class name will be equal to btn only
and whenever someone wants to click on it
will click basically okay
So I'll have to make a function call
which will be named simple clear filters
and this is it the clear filters that are here obviously guys this is me
Where to mention on my reducer
and the reducer I will get there then
When I create it in context
Then I'll be going here
Here okay
all right yes here
So to clear the filters
I just gave a league
To clear the filters
Okay all right I'm in
Here const clear filters will be
equal to as it is nothing to do
Guys I just need to
call the dispatch so tha
I can tell you the type
dispatch it and which is guys
This will be that it will hit
the action method in my reducer
and I'll call it that
guys clear filters
clear underscore filters
Why do I keep misspelling the word filter I don't know
filters and this one here is the
clear filter now I need to put it here
It will have to be defined so that the rest
as many pages as are remaining
Components that can call
this function and use it
So what you can see here
clear filters I'm walking here
I want on my reducer
So that's the return guys below it is
We'll go guys just us
You will have to walk here to define that case
It will fall and do nothing
directly return it as it is
and then all of our
filters now I have
I need to set it and if I need to
reset the value inside the filters
You will have to go back to the original position
Okay so what are we going to do about it
First of all I want that property which I need
Inside the filters individual
Then for him too guys
state filters now I am very
I can do it easily for you something is wrong
and a comma is required here okay
In this way you see what should I do now
Simple this is what
my data is showing I am
I will copy it here because
my original data is that
My original data is the same
Then I'll paste it that's all I need to do
Now this is 00 you can take it
You can also keep it just a little bit of it
To look good
state price maxprice you
can also do this
and maxprice is a bit stubborn
it makes a good impression
Okay so I'm going to go here now
Clear filter is not defined
How is that possible
OK sorry guys we haven't reached it yet
I did not get it I
used the filter context
He didn't get it even though I passed it on
Although I have passed the
filter this one uses a filter
With his help I managed to get it
No I didn't have it but now I' ve got it now this particular one
I can use it anywhere inside the file
Okay my job is done
I run on a computer it's a job
No it's not sung it's not happening
It is indicating that an inspection is being carried out
Here is the maximum price
The maximum price is not matching their value
Oh my god Gays you can see me
Here I have written the price
Then I know you must have found out a long time ago
But what can we do about it Gais
It's hard to remember while coding
But whatever it
is I came here
We need to write
filters I had also said
I wrote
down the price there the maximum price is
I run on mobile I run
on Samsung
black color
If I click on clear filters
all the data comes to me
My work is done
How easily my work is done
I really hope you like today's video a lot
Today with this video
our complete product page
with as many sorting and filters as possible
Whatever there was it is now complete
Our Atlaunch page is now live
We will start our work
How do you feel
Please let me know by clicking below
Thinking is completely free
so that you have no problem
I would like
our next target is one million subscribers
Now if you don't subscribe
Then please subscribe
It will make fun with your friends
And forever a beloved daughter-in-law imos
I'll see you in the video tomorrow
Thank you for showing
me so much Take care