Using Bootstrap in NextJS with Head and Script components from NextJS
This file contains 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 Head from 'next/head' | |
import Script from 'next/script' | |
const index = () => { | |
return ( | |
<Head> | |
<link | |
rel='stylesheet' | |
href='https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css' | |
referrerPolicy='no-referrer' | |
/> | |
</Head> | |
// page content | |
// some code goes here | |
<Script | |
src='https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js' | |
strategy='afterInteractive' | |
/> | |
) | |
} | |
export default index |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment