skip to Main Content

Javascript – How do I transfer the sorting type between components to sort products in ascending or descending order?

I have three components: Parent (HomePage.jsx) export default function HomePage() { const [currentSorting, setCurrentSorting] = useState(); return ( <> <IntroSlider /> <main className="main-content"> <MainContentHeader setSorting={setCurrentSorting} /> <ProductSection currentFuncOfSorting={currentSorting} /> </main> </> ); } Child(ProductSection.jsx) export default function ProductSection({ currentFuncOfSorting })…

VIEW QUESTION
Back To Top
Search