Question: Using Jquery How can I select an option by either its value or text in 1 statement?

```
<select>
   <option value="0">One</option>
   <option value="1">Two</option>
</select>

```

I can do these 2 statements individually but how can I combine the following 2 statements into 1 select OR statement?

```
$('select option[text="Two"]'); //This selects by text

$('select option[value="4"]'); //This selects by value

```

Answer: 
It pretty simple to respond orientation change in react native. Every view in react native have a listener called **onLayout** which get invoked upon orientation change. We just need to implement this. It's better to store dimension in state variable and update on each orientation change so that re-rendering happens after change. Other wise we need to reload the view to respond the orientation change. 

[![enter image description here](https://i.stack.imgur.com/omHkY.gif)](https://i.stack.imgur.com/omHkY.gif)

```
 import React, { Component } from "react";

 import { StyleSheet, Text, View, Image, Dimensions } from "react-native";

 var { height, width } = Dimensions.get("window");

export default class Com extends Component {
constructor() {
    console.log("constructor");
    super();
    this.state = {
        layout: {
            height: height,
            width: width
        }
    };
}
_onLayout = event => {
    console.log(
        "------------------------------------------------" +
            JSON.stringify(event.nativeEvent.layout)
    );

    this.setState({
        layout: {
            height: event.nativeEvent.layout.height,
            width: event.nativeEvent.layout.width
        }
    });
};

render() {
    console.log(JSON.stringify(this.props));
    return (
        <View
            style={{ backgroundColor: "red", flex: 1 }}
            onLayout={this._onLayout}
        >
            <View
                style={{
                    backgroundColor: "green",
                    height: this.state.layout.height - 10,
                    width: this.state.layout.width - 10,
                    margin: 5
                }}
            />
        </View>
    );
}
}

```
OK. I found an answer to this. Need to implement the following in our viewcontroller and call refresh our ReactNative view inside it.

-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation