From the course: Building a React Project with Google Bard and the PalM2 API
Unlock the full course today
Join today to access over 24,100 courses taught by industry experts.
Improving your interface - Bard Tutorial
From the course: Building a React Project with Google Bard and the PalM2 API
Improving your interface
- [Instructor] To finish up this project, we'll do a few quality of life updates. So for example, when I fill something out in here, I have to hit the go button, and I'd like for me to just be able to hit the return key in order to submit things without having to move my mouse. And then also, I'm not really sure, when something is loading, if it's loading at all. I just have to wait and hope that the server doesn't crash. So I'd like there to be a loading indicator in here. So in order to do that, I'm going to go into my code, and I'll start by going to this text area section. I don't know, put this on the next slide just so I can see things a little bit clearer, and I'm going to add an event here called onKeyDown, and I'm going to execute a function that I'm going to create called handleKeyDown. So that'll take care of keeping track of my input as I type it, and then I'm going to create a reference in here. This will allow me…