From the course: Build with AI: Beyond Pair Programming with AI
Unlock this course with a free trial
Join today to access over 25,000 courses taught by industry experts.
Coaching the AI to use modern standards
From the course: Build with AI: Beyond Pair Programming with AI
Coaching the AI to use modern standards
- [Instructor] Once I've detected an old pattern amplified by the AI, I want to use the AI to change my code to use a newer pattern. And chances are it has the necessary patterns in its training data to do this. But we need to bias it towards a different way of doing things. In responsive images DSX, I have this JSX.Element that I want to get rid of. And to do that I'm going to highlight this entire component here and then go into my chat and say, JSX.Element is no longer recommended. Suggest alternatives. Let's see what the system says. So the plan is to replace JSX.Element with React.FC, but React.FC is also not recommended. So I'll say React.FC is also not recommended, suggest alternatives. And at this point it comes up with the right answer. Right now the replacement for JSX.Element is React.ReactElement. So let's see if it can refactor my code to get that to work. So down here we have the same responsive image, but instead of using JSX.Element, it's using React.ReactElement. So…