From the course: Building a GraphQL Project with React.js

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Building a search component

Building a search component

- [Instructor] So for this next part I want go ahead and create a better version of this search section that is right here. So right now, this just displays as a bunch of text and I want to do a proper form. However, it'd be really boring for me to type in a bunch of bootstrap code. So I prepared a special place for you to grab the code from. So I'm going to copy this from here and what I need to do is create a new file, this file will be called SearchBox.js. And in here I'm going to create a constant call it SearchBox and then it's going to have an item in there and we're going to pass along some variables. So totalCount, pageCount, queryStrings. So it'll receive these variables and then it's also going to receive two methods so this is how you pass along methods from a main component to a sub component, on total change and on query change, right. So this is going to be an arrow function and this arrow function is going to…

Contents