Skip to content
Advertisement

React is not showing anything on the screen

I was using function instead of class and the code was working up to certain extent, now it is not displaying at all.

In my VehiclesList.js I generate 10 random vehicles, code below:

JavaScript

In my vehicle.js I have to show the info of the clicked vehicle, react is not showing anything on the screen and I’m lost at this point.

The code below:

JavaScript

I really appreciate any help with this. Thanks!

Advertisement

Answer

Change line in your constructor to this.manufacturer = this.faker.vehicle.manufacturer.bind(this);

Or remove it entirely, you aren’t referencing this.manufacturer in your code anyways.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement