xudafeng / autoresponsive-react-native

Auto Responsive Layout Library For React

Home Page:https://xudafeng.github.io/autoresponsive-react/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Orientation changes not reflecting

pKanijam opened this issue · comments

This one is good at initial load. But when the device orientation is changed then the grid stays the same. Not adjusting the new width of the screen.

Sample_js.txt

Missing componentWillReceiveProps() method in the auto-responsive grid. Added the following and orientation changes are supported.

componentWillReceiveProps(nextProps) {
if (this.props.containerWidth !== nextProps.containerWidth) {
this.sortManager.changeProps({
containerWidth: nextProps.containerWidth
});
}
}