Add key prop to Dropdown items: ensure unique identification for each item in the Dropdown component to prevent rendering issues and improve performance.
This commit is contained in:
		
							parent
							
								
									e189770473
								
							
						
					
					
						commit
						403f394924
					
				|  | @ -27,6 +27,7 @@ export const Dropdown: FC<Props> = ({ items, defaultValue, callback }) => { | ||||||
|       <div className="absolute left-0 z-20 w-48 py-2 mt-2 origin-top-right bg-white rounded-md shadow-xl dark:bg-gray-800 opacity-0"> |       <div className="absolute left-0 z-20 w-48 py-2 mt-2 origin-top-right bg-white rounded-md shadow-xl dark:bg-gray-800 opacity-0"> | ||||||
|         {items.map((item) => ( |         {items.map((item) => ( | ||||||
|           <p |           <p | ||||||
|  |             key={item.value} | ||||||
|             onClick={() => { |             onClick={() => { | ||||||
|               setValue(item.value); |               setValue(item.value); | ||||||
|             }} |             }} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue