Switch
Learn how to choose between two states or values using the Switch component.
We'll cover the following...
The Switch
component in React Native is a controlled component that renders boolean input and modifies its value accordingly. It changes its value based on user decisions. For example, Switch
can be used to toggle dark mode inside an application on or off.
Usage
To implement and use the Switch
component, we first have to import it from the react-native
library.
Press + to interact
import { Switch } from 'react-native';
Once the Switch
...
Access this course and 1400+ top-rated courses and projects.