Skip to content
Advertisement

ReactJs: Generate Random number to display in Material UI progress bar

I am trying to generate random number for test functionality to display in my Material UI Progress bar . This piece of JS code is working in JS fiddle. But I want to show this random number with my reactJs.

Any help/suggestion how can I achieve this.

//Testcode

JavaScript

Advertisement

Answer

Accessing dom elements directly is not a good idea in react. this makes more sense:

JavaScript

this should do it.

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