Click in order · JavaScript and React course · Module 6: React Router
Managing search parameters
Arrange the search params management:
Items to click
- const planetType = searchParams.get('type');
- const [searchParams, setSearchParams] = useSearchParams();
- setSearchParams(prev => { prev.set('type', newType); return prev; });
- const updateFilter = (newType) => {
- };
You can check the correct answer by solving this task in the CodeWorlds game.