Errors 10 exercises
Problem

Fixing "Types Of Property Are Incompatible"

In this exercise, we have a routingConfig object which contains some routes. These routes are an array of objects, each with a path and a component property, both of which are expected to be strings:


const routingConfig = {
routes: [
{
path: "home",
component: "HomeComponent",

Loading exercise

Transcript

00:00 In this exercise, we have some RoutingConfig here, which is an object which contains some routes. The routes here are an array of path, which is a string, and component, which is a string. We then have a CreateRoutes function, which takes this config and puts it in a type here. We have routes, which again, path string,

00:18 component string, which is an array of those routes. If we look inside this RoutingConfig here, we have a mega error. Oh boy, big old error, can't even put it all on the screen at once. Your job is to work out what this mega error is doing. And there are, I think, three or two or three different ways that we can,

00:37 because there is a little component 12 here, which might look a bit out of place. There are a couple of ways that we can make this error more obvious as to what it's doing, and actually get our error a bit closer to where we want it and make it a bit more readable. So your job is not necessarily to solve the error,

00:55 but to make the error more readable and actually have it on this line here. Good luck.