0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Reactの基本知識

Last updated at Posted at 2022-04-05

React-native での基本知識
ComponentsにはJSX, Props, State

JSX
render関数が返すJSXによって画面描写
JSXでComponentの見た目を定義

example
   render(){
       return(
        <View>
          <Text>Hello World</Text>
        </View>
   );
 }

PropsとStateの違い

Propsは性質や、変わることのないものを表す(不変)
Componentの”性質”を定義
親から子に情報を渡す

example
props.gender: female

Stateは状態や、変わりえるものを表す(可変)
Componentの”状態”を表現
可変な値
stateを変更することで画面が更新される

example
state.hungry: false
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?