Created
May 1, 2017 18:11
Example bootstrap 4 integration into Next.js, with the reactstrap package
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 { Container } from 'reactstrap' | |
const Layout = (props) => ( | |
<div> | |
<Head> | |
<title>PairHub</title> | |
<meta name="viewport" content="initial-scale=1.0, width=device-width" /> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" /> | |
</Head> | |
<Container> | |
{props.children} | |
</Container> | |
</div> | |
) | |
export default Layout |
Try this:
<NavItem>
<Link href="/foobar" passHref>
<NavLink>foobar</NavLink>
</Link>
</NavItem>
I get the following error when using this approach.
Unexpected token export
C:\Users\user\WebstormProjects\site_ui\node_modules\react-popper\lib\react-popper.js:1
(function (exports, require, module, __filename, __dirname) { export { default as Manager } from './Manager';
^^^^^^
SyntaxError: Unexpected token export
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:607:28)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\user\WebstormProjects\site_ui\node_modules\reactstrap\dist\reactstrap.cjs.js:14:19)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
any idea about fixing react-popper.js
?
I'm having the exact same error that @hooman-limouee. Any ideas?
@hooman-limouee downgrading reactstrap to v5.0.0-beta fixed this issue for me
@DavyBello downgrading didn't work here, did you do anything else?
Same issue with react-popper on beta-2
Switching back to v5.0.0-beta worked for me too.
Official Reactstrap Issue about it: reactstrap/reactstrap#870 with workaround explained
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@tharakabimal I did it this way:
Not sure if the hashes will cause an issue down the line with fragments, but for my simple menu this has worked.