**Project 25+5 Clock “done” but its built in React 18.2.0 **
The test script wont work,
after a little googling, I found:
You should use ReactDOM.render instead of ReactDOM.createRoot in order to pass the tests for the 25 + 5 Clock.
Sorry for the clickbait title - I couldn’t help it.
Tell us what’s happening:
Using the latest version of React (18) seems to break the FCC tests for this project. This only happens if you use the new ReactDOM.createRoot entry point, which is recommended by React in their documentation. This took me two days to figure out, so I wanted to bring it up in case anyone else has th…
05:23PM - 11 May 22 UTC
status: work in progress
I have edited this issue.
Code that is passing using React 17 is failing with
I won’t know if the project is done or not
How should I proceed?
Your browser information:
User Agent is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/18.104.22.168 Safari/537.36
Challenge: Front End Development Libraries Projects - Build a 25 + 5 Clock
Link to the challenge:
I was able to follow
this article to get your app running using React 17 and your app passes 26 out of the 29 tests.
The main points are:
Make the following changes to your
Make the following changes in your
import ReactDOM from 'react-dom/client';
import ReactDOM from 'react-dom';
const root = ReactDOM.createRoot(document.getElementById('root'));
const root = document.getElementById('root');
NOTE: Of the 3 tests you are failing, you can easily fix the one where the sound plays when the timer hits
00:00. The other two tests are technically testing for an invalid app. The tests actually expect the timer to go from
00:00 back to the applicable session or break length time. Of course doing this ends up adding one second more to each session and break. Over an hour, this would add 1 extra minute of session and 1 extra minute of break. You will have to hack your valid timer (in my opinion) just to pass the tests.
Thank you so much
@RandellDawson for your time and help!
Downgraded react to 17.0.2 and the tests work again
It was a really good idea
( p.s. gotta do what you gotta do to pass the tests )
Have great day!