+ 1
How to make sure that the component is not redrawn?
I need 2 conditions to be met: 1) When you click on the «Increase temperature by 1 degree» button, the temperature increased 2) The TempDisplay component should not be redrawn when you click on the «Increase by 10 seconds» button https://code.sololearn.com/WqNNZYOaONoQ/?ref=app https://code.sololearn.com/W5TL65B4BaQJ/?ref=app
4 odpowiedzi
+ 4
I'm a bit confused by your codes.
You want a button to do something, but you don't have any button in the codes.
I believe you aren't closing all of your curly brackets {}, they need a pair 1x { and 1x }.
You have a lot of "const" in there and they should only be used for variables which don't change values.
+ 2
Can you post the task completely?
Also, all of your code, including buttons.
0
Yes, the buttons I have not written in this code, but the task is that after "1 usage new *
const increaseTemp=" add code so that 1) When you click on the button "Increase the temperature by 1 degree" the temperature increases 2) TempDisplay component should not be redrawn when you click "Increase by 10 seconds
0
As I understand it, it should be done through useMemo