December 2019
Intermediate to advanced
598 pages
12h 21m
English
A query parameter is part of the URL that allows additional parameters to be passed into a path. For example, /search?criteria=typescript has a query parameter called criteria with a value of typescript.
In this section, we are going to implement a query parameter on the search page called criteria, which will drive the search. We'll implement the search page along the way. Let's carry out these steps to do this:
export const searchQuestions = async ( criteria: string,): Promise<QuestionData[]> => { await wait(500); return questions.filter( q => q.title.toLowerCase().indexOf(criteria.toLowerCase()) >= 0 || q.content.toLowerCase().indexOf(criteria.toLowerCase()) ...Read now
Unlock full access