Skip to content

Tag: reactjs

how to enable top level await in reactjs

I have installed craco using yarn add @craco/craco I have also replaced the scritps and have created a craco.config.js but when I’m trying to use await at top level I’m still getting this error in my react app Answer In the craco docs, it says you need to add a configure block to handle any webpac…

D3 text in alignment with rect

I have rect and a description text above chart – Issue is description text is not getting properly aligned with rects. Description is getting mixed into rects. I want to start text after rect ends. I have below code – HTML getting generated for color rect and description text – How can I avo…

Compare value of two arrays

Five random numbers(from numbers array) will be shown one by one and we need to recall last four number by clicking the number. The answers are push to answer array after clicking. Now i need to compare answers array and number array to calculate the score. My problem is in scoring logic which is not working …