바코더의 블로그

  • 홈
  • 태그
  • 방명록

reactnative 2

2.React-Native(리액트 네이티브) SharedData(Context) -2

Context 를 이용한 데이터의 공유는 read-only 가 아니다. 즉 어디서든 Context 를 이용해서 Data를 불러올 수 있고, 동시에 어디서든 Context 의 값을 변경할 수 있다는 것이다. UpdateSharedContext.js import React, { createContext, useState } from "react"; export const StatusContext = createContext(); export function StatusProvider({ children }) { const value = useState("init status"); return ( {children} ); } Context를 이용해서 Provider를 만들어 주는데, Context 의 valu..

카테고리 없음 2021.02.26

2.React-Native(리액트 네이티브) SharedData(Context) -1

리액트 네이티브에서 사용되는 Data는 윗 Component 에서 Nested Component 로 Depth를 이뤄가면 전달되는 방식이기 때문에 쓸데없이 중간 Component 들이 Props를 받아야 하는 어러움이 있다. 이걸 해결해주는게 Hook 의 Context 이다. UseContext 사용하지 않는 코드 아래 샘플 코드는 Context를 사용하지 않고 기존의 방식대로 Component에게 정보를 전달한다. import React, { Fragment,useState,useEffect } from 'react'; import OldComponent from './SharedContext/OldComponet'; const App =()=>{ const [user, setUser] = useSta..

카테고리 없음 2021.02.26
이전
1
다음
더보기
프로필사진

바코더의 블로그

바코더의 이거저거

  • 분류 전체보기
    • aws
    • Kubernetes
      • Kubernetes in Action
      • Docker
      • Kubernetes 연습
      • Helm
      • Istio(Gasida Study)
    • 안드로이드
      • 공부
      • Kotlin
    • React-Native
      • 공부
    • Linux(Ubuntu)
    • Flutter
      • Web

Tag

플러터 웹, 안드로이드 #코틀린 #, aws, placement group, Kubernetes, 리액트, 배치그룹, 쿠버네티스, kubeadm, Kubectl, architecture #, 코틀린, MouseRegion, 리액트 네이티브, react, react native, flutter web, reactnative, Kotiln, react-native,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/10   »
일 월 화 수 목 금 토
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바