Search code examples
reactjsreact-hooksdropdownprimereact

Prime react dropdown default value not showing for API calls


Here is my code snippet

https://codesandbox.io/s/dropdown-primereact-gjcdm0?file=/src/demo/DropdownDemo.js

I am making an API call for my dropdown, Expected: The currency codes should be visible on drop down once I select it and also the options should be showing up

Actual: The currency is not visible on the dropdown, but the options are correctly fetched and placed in dropdown

Please let me know if I can persist the value onClick on the dropdown


Solution

  • I fixed your Sandbox its now working: https://codesandbox.io/s/dropdown-primereact-forked-sjskrb?file=/src/demo/DropdownDemo.js