Got "accessed not trying to read property" on this code. What is wrong?

You’re trying to access the component before you create it.