Front-End 5th project 25+5 Clock

I created 5th project using hooks and react version 18.1,
I think I nearly completed all the tests except #Alarm section but the tests have shown me failure
In #Content test; I checked ID’s of html tags they are all there. But giving me a false result of #time-left is not available.
In the #Timer test; showing failure about timer did not reach 0. And not checks other ones as well. Here is the link of codepen: 25+5 Clock.

Thank you for helping me out. :slight_smile:

1 Like

if it’s working normally and it’s functional, then good work. you did it👍

freeCodeCamp test codes for 25:5 clock, don’t get along too well with the new render method of ReactDOM 18 (react strict mode).

Try replacing

const root = ReactDOM.createRoot(document.getElementById('root'));
    <App />

with the old react rendering

ReactDOM.render(<App />, document.getElementById('id'));
1 Like

This message is for people, who are facing similar issue, you can track the developer team progress in this issue here.

Know that this issue is more difficult than it seems, and the volunteers are doing what they can.:green_heart:

Have a nice day and happy coding

1 Like

Thanks for your compliment Sboonny :slight_smile:
And thank you for your reply, I tried that now but tests failing with Strict Mode render method also. I will be trying to downgrade to 17th version of react to see if it works (as the github link suggests) I hope its easy to do so :sweat_smile:.

It was nice to work with hooks which I mostly liked useReducer; helped me to hold a good state of the program :slight_smile:
useReducer hook helped me with; not using redux for states :slight_smile:

I think React is getting somewhere with this state and hook methods. Otherwise it is hard to maintain the one way flow if one wants to upgrade the program again and again.

Unless the certification needed for academic reason, I would suggest moving to the next course.

People are trying to fix it, so you don’t have to make adjustments. You can follow the issue and when you receive notification that it’s closed. Claim certification.

I do like the new state of react too, they definitely moving to the right direction. Can’t wait to see, how much change we will see in 3 or 4 years.

1 Like

Thank you Muhammed :slight_smile:
I was thinking to apply jobs after this certification. My family expects much of me :smiley:.
But its wise to follow your advice, I came so far that; i cant go back now, only further :slight_smile:


I hope you have an easy time finding jobs.

Good luck. I don’t if this will help, but I hope it will.

Is there something I can help with the tests? Because this feels like going to take too long, the people who is solving this problem is not enough (4 people last message was 17 days ago). Or should I start the same project with older version again?

I did not really look much at the code but my first instinct is to suggest you try without accurateInterval and just use a “normal” setInterval.

The test will “hack” setInterval and setTimeout and it should finish pretty quick as it will speed up the timer. You can see that isn’t working with your project.

Also, as I said on the GitHub issue the example project (and my own) is passing the tests just fine (with the correct version of React).

Edit: the example project just in case

1 Like

Thank you Lasjorg, I will let you know.
I will be changing to setInterval version.

I tried to use setInterval method with returning cancel tests was still slow(without accurateInterval method), I used setInterval method without a returning cancel function but the tests are still slow.

Time-left is not formatted correctly error still shows up.

But its there and formatted correctly.
Thank you for your help.

As long as the test isn’t able to hack the timer I wouldn’t rely on the code. I might suggest trying a simplified version first.

BTW, the pause unpause doesn’t seem to work.

1 Like

Hi Lasse,
Pause Unpause problem is fixed now thanks for the warning :slight_smile:
It might because of the the id #time-left which I tried many things to solve the problem the test is not seeing it.

What the code should be like (setInterval code example) for the test to hack my code for testing faster then? Thank you for your help.

EDIT: Thanks to FreeCodeCamp and its contributors I just passed Linkedin skill test of react.js :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.