-
Notifications
You must be signed in to change notification settings - Fork 584
FAQ
Yes, but it's not recommended for animations other than Slide due to how other page elements are designed to move with the transition.
You can access it through the bmMenuWrap
key of the styles
prop:
var styles = {
bmMenuWrap: {
transition: ''
}
}
<Menu styles={ styles } />
react-burger-menu uses Radium to manage its styles. To use the Link
component, you need to wrap it in Radium first, like this:
import React from 'react';
import { stack as Menu } from 'react-burger-menu';
import { Link } from 'react-router';
import Radium from 'radium';
let RadiumLink = Radium(Link);
export default React.createClass({
render() {
return (
<Menu>
<RadiumLink className="menu-item" to="/home">Home</RadiumLink>
<RadiumLink className="menu-item" to="/settings">Settings</RadiumLink>
<RadiumLink className="menu-item" to="/blablabla">Blablabla</RadiumLink>
</Menu>
);
}
});
I'm getting a Warning: React attempted to reuse markup in a container but the checksum was invalid
error.
When rendering this component on the server, you need to pass the user agent via the radiumConfig
prop so Radium knows which vendor prefixes to apply.
This is an example of how that would look using Express:
<Menu radiumConfig={{userAgent: req.headers['user-agent']}} />
See the docs on server-side rendering.
Unlike the rest of your content, fixed elements need to be placed outside your page-wrap
element, so your layout structure will look something like this:
<div id="outer-container">
<header>I am a fixed header!</header>
<Menu pageWrapId={ "page-wrap" } outerContainerId={ "outer-container" } />
<main id="page-wrap">
.
.
.
</main>
</div>
A common use for this is a fixed header, but the same applies to any elements you want to remain fixed and positioned relative to the viewport.