(props?: IContextViewProps)
| 44 | * It's a hook used in functional component |
| 45 | */ |
| 46 | export function useContextViewEle(props?: IContextViewProps) { |
| 47 | const [contextView, setContextView] = useState<IContextView>(); |
| 48 | |
| 49 | useEffect(() => { |
| 50 | // The useContextView can't be called at initial of useState |
| 51 | // Because this function has rendered an element |
| 52 | setContextView(useContextView(props)); |
| 53 | }, []); |
| 54 | |
| 55 | return contextView; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * TODO: It's not a hook, don't begin with use |
no test coverage detected