score:32
its type definition from flow, it means that constant app is of type function and it returns reactnode.
reactnode is one of these types: reactchild | reactfragment | reactportal | boolean | null | undefined
this means the function app can return, any valid jsx (in react native its anything from view, text, .etc), reactfragment, react.portal, boolean, null, undefined
if you are confused about the dollar sign, here is a link with explanation. https://www.saltycrane.com/flow-type-cheat-sheet/latest/
there are separate sections for "private" or "magic" types with a $ in the name. see the note here and comment here. update: some these types are now documented here.
for easy you can think of it as its node
from react
(think of it as scope/namespace)
score:1
react$node is a type defined in react.js
declare type react$node =
| null
| boolean
| number
| string
| react$element<any>
| react$portal
| iterable<?react$node>;
score:4
it is also a type of declaration of app component as a function but you can change it to
import react, { component } from 'react';
import { platform, stylesheet, text, view } from 'react-native';
export default class app extends component {
render() {
return (
<view style={styles.container}>
<text style={styles.instructions}>hello world!</text>
</view>
);
}
}
const styles = stylesheet.create({
container: {
flex: 1,
justifycontent: 'center',
alignitems: 'center',
backgroundcolor: '#f5fcff'
},
instructions: {
textalign: 'center',
color: '#333333',
marginbottom: 5
}
});
don't forget to remove statement export default app in the last line.
Source: stackoverflow.com
Related Query
- const App: () => React$Node = () => {...}: what does it mean this instruction?
- const {name, value} = event.target -- what does this mean
- What does it mean to 'move this variable directly inside useEffect' in this error message?
- What does this render method do: const {images, selectedImage} = this.state;?
- What does this line of code mean? const {"intl": { formatMessage }, } = this.context
- I don't understand what this const expression does in ReactJs / ECMAScript6
- In React-Router docs, what does this paragraph mean in the "Index Routes" section?
- What does the bracket mean in this situation in React?
- What does this mean in React?
- What does this syntax mean export default connect(mapStatetoProps, mapDispatchToProps)(LandingComponent)
- What does this piece of code mean when setting state?
- npm install error: what does this mean exactly? How to fix it?
- What does this it mean when assigning to a { ... } object in javascript?
- What does && mean when used this way, and what is it called?
- How does npm build know what url to proxy - where is this instruction stored?
- What does this "react-scripts eject" command do?
- What does it mean when they say React is XSS protected?
- What does ...rest mean in React JSX?
- What does :: (double colon) mean in JavaScript?
- What does this warning message mean? 'img elements must have an alt prop, either with meaningful text, or an empty string for decorative images'
- What does @format mean in new react native App.js?
- React Source code: What does it mean by "real internal dependencies"
- What does the @ symbol mean in a react import statement
- TypeScript What does this grammar '-?' (dash question) mean?
- What does the symbol '&$checked' mean
- What does the isVisible property mean in intersectionObeserver API?
- What does the '@' mean in front of an import in React?
- What does "...this.props" mean in ReactJS?
- What does this React code with an anonymous closure do for validateFormat?
- What does return { ...state, } in this reducer exactly mean?
More Query from same tag
- Unable to render collection data from firebase in react
- Toggle a class only to one element at each click of the mouse - React hooks
- How can I ensure that a line of code is executed only once using React hooks in a functional component?
- How to pass a value to a StaticQuery using props string?
- jQuery fullCalendar displayed undefined on title
- Correctly create global variables in React
- Manifest: Line: 1, column: 1, Syntax error on Chrome browser
- Using Jest to Mock Axios and Mock Windows.Location.Assignment
- How can I set initial React state from API data?
- how to get axios.get data and where to put it in redux reducer initial state
- Unable to view state data in redux dev tools
- React – Using auth0 user data in class component
- Why redux store only get value of last dispatch Action
- Why is TinyMCE displaying HTML tags?
- React cancel out of Promise on props change
- Plug in or pattern for dealing with large forms in React?
- How should I trigger an XHR on component MouseClick using CalmmJS and React?
- Upload files from (Fast)API to Azure Blob Storage
- How to center-align a custom SVG icon in a Material-UI IconButton
- How to pass from a react props to a sass variable?
- Material UI Menu component is not getting the styles applied in react
- Create a new row through a rendered React component
- Split react component return
- DOM Manipulation With `useEffect()` vs. `useLayoutEffect()`
- npm ERR! code ERR_SOCKET_TIMEOUT on creating new React project when using npx create-react-app
- how to apply tooltip for each datalist option element in Semantic UI React
- Opening Same Modal Window from different Components and communicating exact parent
- How to structure a React app to pass values returned from a child's function
- React + Styled Components - separating and re-using css "bundles"
- Get message id from notistack snackbar