componentWillReceiveProps(nextProps){
console.log("nextProps",nextProps)
}
if (location== '/index/loc1') {
console.log("loc1")
} else if (location== '/index/loc2'){
console.log("loc3")
}else{
console.log("else",typeof location)
}
if (k === 37 && location=== '/index/loc1') {
history.push('/index');
}
else if (k === 39 && location=== '/index') {
history.push('index/loc1');
}else{
}
switch(location){
case k === 37 && '/index/loc1':
alert( '/index/loc1' );
break;
case k === 39 && '/index/loc2':
alert( '/index/loc2' );
break;
}