i am facing issue with the setting style for html div attribute in reactjs without jsx.
I am calculating height for the div from calculateAvailableHeight()
so that div content is managed with overflow:auto. but unfortunately I cannot set style for div tag.
versions:
"react": "^16.6.3",
"react-bootstrap": "^0.32.4",
"react-dom": "^16.6.3",
Here is reactjs code for react component
import React,{Component} from "react";
import {Row,Col,Tab,Nav,NavItem} from 'react-bootstrap';
import {calculateAvailableHeight} from './../../lib/uiComponentLib
var heightList = calculateAvailableHeight(50);
var ccUserStyle = {
height : heightList ,
overflow:"auto !important",
};
output for heightList : 568px !important
class UserList extends Component{
render(){
console.log("Reaching inside ", heightList );
return (
<div style={ccUserStyle}>
<Tab.Container id="sidebarTabContainer" defaultActiveKey="first" >
<Row className="clearfix">
<Col sm={12} className="cc-no-padding">
<Nav bsStyle="pills" justified>
<NavItem eventKey="first">User</NavItem>
<NavItem eventKey="second">Group</NavItem>
</Nav>
</Col>
<Col sm={12} className="cc-no-padding" style = height= {heightList} >
<Tab.Content animation>
<Tab.Pane eventKey="first">
Userlist
</Tab.Pane>
<Tab.Pane eventKey="second">Group list</Tab.Pane>
</Tab.Content>
</Col>
</Row>
</Tab.Container>
</div>
);
}
}
I am using ccUserStyle object
to set div style. But after rendering the component i don't see any style attribute for div tag.
Please suggest and help me to rectify this issue.
Thanks in advance.