Added interaction between MFE and Legacy tagging functionality for xblocks on the Course unit page.
12 lines
318 B
TypeScript
12 lines
318 B
TypeScript
import { useContext } from 'react';
|
|
|
|
import { IframeContext, IframeContextType } from './iFrameContext';
|
|
|
|
export const useIframe = (): IframeContextType => {
|
|
const context = useContext(IframeContext);
|
|
if (!context) {
|
|
throw new Error('useIframe must be used within an IframeProvider');
|
|
}
|
|
return context;
|
|
};
|