Created
August 22, 2020 11:04
-
-
Save rshackleton/49686ceb34b0ce606a820899f351a039 to your computer and use it in GitHub Desktop.
Smart Link SDK with Gatsby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import KontentSmartLink from '@kentico/kontent-smart-link'; | |
import '@kentico/kontent-smart-link/dist/kontent-smart-link.styles.css'; | |
export default function Layout({ children }) { | |
useEffect(() => { | |
const kontentSmartLink = KontentSmartLink.initialize({ | |
queryParam: 'preview-mode' | |
}); | |
return () => { | |
kontentSmartLink.destroy(); | |
}; | |
}); | |
return ( | |
<div class="layout">{children}</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment