我正在动态地改变语言,所以我想从rtl切换到ltr,反之亦然。
我使用bootstrap-rtl来支持rtl。
下面是我的代码:
componentWillReceiveProps(nextProps) {
if (this.props.isRTL !== nextProps.isRTL) {
if (nextProps.isRTL) {
require('bootstrap-rtl/dist/css/bootstrap-rtl.css');
} else {
//what should i do here??