To use Icon component you need to install react-native-vector-icons dependency. If you want to start a new project with a specific React Native version, you can use the -version argument: react-native init ProjectName -version X.XX.X react-native init ProjectName -version will make a project structure with an index file named App.js in your project directory. ![]() Run the following commands to create a new React Native project react-native init ProjectName Open the terminal and go to the workspace and run npm install -g react-native-cli Assuming that you have node installed, you can use npm to install the react-native-cli command line utility. We are going to use react-native init to make our React Native App. Getting started with React Native will help you to know more about the way you can make a React Native project. In this example, We will create a simple Screen with different icons and will run it in Android and IOS. I think this is enough now let’s get started with the example. We are also going to use these components in our example. Styles applied to the icon only, good for setting margins or a different color. Note: use iconStyle for margins or expect unstable behaviour.īorder radius of the button, set to 0 to disable.Ī function called when the button is pressed. Text and icon color, use iconStyle or nest a Text component if you need different colors. What icon to show, see Icon Explorer app or one of the links above.Ī convenience component for creating buttons with an icon on the left side. Size of the icon can also be passed as fontSize in the style object. Prop “name” will render the icon in Android and IOS. ![]() You can use this Icon component to create Icons.
0 Comments
Leave a Reply. |