0% found this document useful (0 votes)
5 views4 pages

React Native Round 1

react native notes

Uploaded by

Preeti Yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

React Native Round 1

react native notes

Uploaded by

Preeti Yadav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1. What is the correct syntax to define a functional component in React Native?

function MyComponent = () => {}

const MyComponent = function() {}

const MyComponent = () => { return <View />; }

MyComponent() => <View />

2. Which core component is used to render text in React Native?

<TextView>

<Label>

<Text>

<Paragraph>

3. What is the correct way to pass data to a child component in React Native?

this.state = childData

data = {childData}

<ChildComponent props={childData} />

<ChildComponent data={childData} />

4. Which hook allows a functional component to manage internal state?

useState

useContext

useEffect
useRef

5. What does the useEffect hook typically replace?

setInterval

setTimeout

Component lifecycle methods like componentDidMount

useState

6. Which navigator is used to switch between screens in a stack format?

BottomTabNavigator

StackNavigator

SwitchNavigator

TopTabNavigator

7. How do you install a package in a React Native project?

node install

yarn start

npm install package-name

react-native install package

8. What is the default styling unit in React Native?

px

em
There is no unit; all numbers are unitless and treated as dp

dp

9. Which component is best for displaying a scroll able list of items?

<List>

<FlatList>

<ScrollItems>

<Table>

10. What is the purpose of the Safe Area View component?

To avoid overlapping with system UI (like notch and status bar)

To create safe clickable areas

To apply default margins

To prevent memory leaks

11. How do you handle user input in React Native?

Using <InputBox>

Using <TextField>

Using <TextInput> and tracking with onChangeText

Using HTML <input> tag

12. Which command runs a React Native app on an Android emulator?

react-native run-ios
react-native run-android

yarn android

expo start android

13. Which of the following is used for conditional rendering?

if...else inside JSX

switch statement in render

Ternary operator or && in JSX

All of the above

14.Which hook is used to reference an element or store mutable value without


re-rendering?

useEffect

useMemo

useRef

useCallback

15. How do you apply styles in React Native?

Inline CSS only

External CSS files

Using the StyleSheet API

Using Tailwind CSS by default

You might also like