Skip to content

Instantly share code, notes, and snippets.

@max107
Created November 25, 2015 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save max107/3c844561932f5f95c104 to your computer and use it in GitHub Desktop.
Save max107/3c844561932f5f95c104 to your computer and use it in GitHub Desktop.
class Alert extends React.Component {
render() {
return (
<div className='alert'>alert</div>
)
};
}
class Header extends React.Component {
render() {
return (
<div className='header'>header</div>
)
};
}
class App extends React.Component {
componentDidMount() {
this.heightHeader = React.findDOMNode(this.refs.header).innerHeight;
}
render() {
var heightAlert = 30;
var divStyle = {paddingTop: 20 + this.heightHeader + heightAlert};
return (
<div style={divStyle}>
<div className='top'>
<Alert/>
<Header ref="header"/>
</div>
Контент
</div>
)
};
}
React.render(
<App />,
document.getElementById('example')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment