Hi there,
I’m a beginner in Programmation and I have this simple code and it doesn’t work. I just want to create an alert when I click on the button. I can’t see the problem thank you very much.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
Thank you very much. I would like to create a class because this is the first step of the exercise. After this, I have to do a flip book. I will use the button to turn the pages of the book. I will use state and setState (I guess). Sorry if my English is not perfect I’m French.
The this there refers to the footer component, not the transform component.
Also, in React, component names should be CamelCase.
Also:
constructor(transform) {
super(transform);
Traditionally that variable is not called “transform” but is called “props”.
Also, you don’t really need a constructor there - you don’t need to bind your this if you use arrow functions. But you may not have been taught that yet.
Maybe I learn less fast than teachers learn me With no joke I just start to learn React from few days. And I have to do a flip book for my portfolio. I will change the Alert by some animations on a div. It’s not simple thank you.