Why is my drop down empty

I’d guess you may have figured this out by now. Here’s my answer anyway.

You say the API returns an array whose object items have label and value properties but if I try that same request I get an array whose object items have name and id properties (as you would expect when you specify _fields: [ 'name', 'id' ]. That won’t work for passing to SelectControl as options. You’d need to map the array to create one with the properties required (label and value).

setCategories( response.map( ({ name: label, id: value }) => ({ label, value }) ) );

I do not see any errors in the console but I see that categories is a empty array

If you log categories just after you setCategories it’s going to be stale (the value it was already). Setting state in React is not synchronous and categories won’t have the latest value until the component renders again (as setting state queues it to do).

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)