If I console.log(persons), it shows up for a fraction of a second and then disappears (it originally flashed an object, but now it flashes uncaught). If I type persons in the console it gives this error: VM675:1 Uncaught ReferenceError: persons is not defined at :1:1.
Anyone know what’s causing the error and why the console.log isn’t staying on the screen? Thanks
Ok, maybe it’s just something on my end. I’m tring to get the names to print below ‘Numbers’. Can you give me a hint as to where I’m going wrong? Heres where I’m at so far. Thanks
Ya, got it working, but now it’s giving me: ‘Warning: Each child in a list should have a unique “key” prop.’ I guess I’m doing that wrong? And thanks for the tip about useEffect. That’ll come in handy!
Ya, I know, I was wondering about that too. I’m just following a tutorial. I’m sure they’ll go into that further a long. They just said to just use the names for now. In the next exercise, we’re supposed to: “Prevent the user from being able to add names that already exist in the phonebook.”
I used nanoid once before. Haven’t used UUID yet, but I’ll try it if they don’t go into it before the end of this project.
Thanks for pointing that out. Just read something about that yesterday. Totally forgot.