REACT-native

김린네·2022년 4월 2일

🚗 REACT NATIVE

공부중 헷갈린거 정리

const[state,action]= useREducer(change_initial, initial);

여기서 action을 이용해서 chage_iniital 에게 전달하는거 까지는
기본적인 개념이여서 알겠는데

const hey-action=(action)=>{
return()=>{
action(type:'change_hey')
}
}
여기 부분에서

hey-action 을 뽑으면 리턴 부분만 나오게 되고
여기에 action 함수는 이 창에 없으니까
이 action 을 연결 해서 보내주고 싶으면

var ba={};
<여기서 obejct 형식으로 보내고

for (var hey in action)]
{
ba[hey]]=action[hey].action();
이 게 이해가 안되는데

}

ba={
action: {type:'chage_hey'}
}

이런식으로 되고
...state , ba <
이러면 전체 state

우리가 그러면

action. type:=> 이런식으로 연결되는건가..?요?
모르겟다....

😂😀😳

profile
디자인 > https://dribbble.com/jongpil_77 코딩 > https://www.codewars.com/users/bikijjang

0개의 댓글