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.
		
		
		
		
		
			
		
			
	
	
		
			15 lines
		
	
	
		
			496 B
		
	
	
	
		
			TypeScript
		
	
		
		
			
		
	
	
			15 lines
		
	
	
		
			496 B
		
	
	
	
		
			TypeScript
		
	
| 
											2 years ago
										 | import { createContext, useContext } from 'react'; | ||
| 
											3 years ago
										 | 
 | ||
|  | /** | ||
|  |  * This React context is used to share deeply in the tree of the ConversationListItem what is the ID we are currently rendering. | ||
|  |  * This is to avoid passing the prop to all the subtree component | ||
|  |  */ | ||
| 
											2 years ago
										 | const ContextConversationId = createContext(''); | ||
| 
											3 years ago
										 | 
 | ||
|  | export const ContextConversationProvider = ContextConversationId.Provider; | ||
|  | 
 | ||
|  | export function useConvoIdFromContext() { | ||
|  |   const convoId = useContext(ContextConversationId); | ||
|  |   return convoId; | ||
|  | } |