Skip to content

Instantly share code, notes, and snippets.

@rshackleton
Created August 22, 2020 11:04
Show Gist options
  • Save rshackleton/49686ceb34b0ce606a820899f351a039 to your computer and use it in GitHub Desktop.
Save rshackleton/49686ceb34b0ce606a820899f351a039 to your computer and use it in GitHub Desktop.
Smart Link SDK with Gatsby
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