Tony Won
Hyeseong Kim
10/06/2020, 12:47 PMTony Won
Hyeseong Kim
10/06/2020, 12:48 PMHyeseong Kim
10/06/2020, 12:49 PMHyeseong Kim
10/06/2020, 12:49 PMTony Won
Tony Won
Tony Won
Hyeseong Kim
10/06/2020, 12:57 PMTony Won
Hyeseong Kim
10/06/2020, 1:02 PMconst data = useFragment(..., <http://props.post|props.post>);
// 가상의 폼 상태
const post = useForm({
init: <http://data.post|data.post>,
});
const optimisticResponse = opt_response_from_input(post);
const updatePostMutation = useMutation(...);
const handleSubmit = () => {
updatePostMutation.commit({
variables: post,
optimisticResponse,
});
}
<Form onSumit={handleSubmit}>
<PostInput post={post} />
<Preview post={optimisticResponse} />
</Form>
뭐 간단한 CRUD라 치면 얼추 이런식일까요Hyeseong Kim
10/06/2020, 1:06 PMHyeseong Kim
10/06/2020, 1:07 PM@exports
디렉티브 같은거 쓰려고 일부로 스토어에 우겨넣는 경우가 종종 있긴 한데Hyeseong Kim
10/06/2020, 1:11 PM그 컴포넌트를 미리보기에서 쓰려면 어떻게하는게 좋을지?이건 그냥 컴포넌트 잘 나누면 해결될 것 같아요. 그냥 상태없는 컴포넌트 하나 두고 props을 다른걸 주는식으로 간단하게 조합하시면...
Tony Won