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: 
For more recent versions of React Native, orientation change doesn't necessarily trigger onLayout, but `Dimensions` provides a more directly relevant event:

```
class App extends Component {
    constructor() {
        super();
        this.state = {
            width: Dimensions.get('window').width,
            height: Dimensions.get('window').height,
        };
        Dimensions.addEventListener("change", (e) => {
            this.setState(e.window);
        });
    }
    render() {
        return (            
            <View
                style={{
                    width: this.state.width,
                    height: this.state.height,
                }}
            >
            </View>
        );
    }
}

```

Note that this code is for the root component of an app. If using it deeper within the app, you will need to include a corresponding removeEventListener call.
Appart from the answer given by user `Rajan Twanabashu` you can also use the [react-native-styleman](https://github.com/anubhavgupta/react-native-styleman) library to handle orientation change very easily: 

Here is an example of how you would do that:

```js
import { withStyles } from 'react-native-styleman';

const styles = () => ({       
    container: {
        // your common styles here for container node.
        flex: 1,
        // lets write a media query to change background color automatically based on the device's orientation 
        '@media': [
          {
             orientation: 'landscape', // for landscape
             styles: {                 // apply following styles
                // these styles would be applied when the device is in landscape 
                // mode.
                 backgroundColor: 'green'
                 //.... more landscape related styles here...
             }
          },
          {
             orientation: 'portrait', // for portrait
             styles: {                // apply folllowing styles
                // these styles would be applied when the device is in portrait 
                // mode.
                 backgroundColor: 'red'
                 //.... more protrait related styles here...
             }
          }
        ]
    }
});

let Component = ({ styles })=>(
    <View style={styles.container}>
        <Text>Some Text</Text>
    </View>
);

// use `withStyles` Higher order Component.
Component = withStyles(styles)(Component);

export {
  Component
};

```