I had the same issue, but once I told it that those functions don’t exist, it actually generated a working one
oh interesting. i was telling it that things did not exist so it kept responding with code snippets that were invalid in react