You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			14 lines
		
	
	
		
			293 B
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			14 lines
		
	
	
		
			293 B
		
	
	
	
		
			TypeScript
		
	
| import { useCallback } from 'react';
 | |
| 
 | |
| /**
 | |
|  * This memoized function just returns a callback which can be used to disable the onDragStart event
 | |
|  */
 | |
| export const useDisableDrag = () => {
 | |
|   const cb = useCallback((e: any) => {
 | |
|     e.preventDefault();
 | |
|     return false;
 | |
|   }, []);
 | |
| 
 | |
|   return cb;
 | |
| };
 |