이전글 [**"\[React\] Mobx-state-tree 학습하기 #7 : Remove Model Instances from the Tree"**](/zzan/@anpigon/react-native-manage-application-state-with-mobx-state-tree-7)에서 이어지는 내용입니다. 참고로 이 포스팅은 제가 학습한 내용을 노트에 정리하듯이 기록하여 올리는 글이기 때문에 보팅 안해주셔서 됩니다. 많은 분들이 코딩에 흥미를 느꼈으면 좋겠습니다. ㅋ <br> ***  * 출처: https://egghead.io/courses/manage-application-state-with-mobx-state-tree *** <br> ## Create an Entry Form to Add Models to the State Tree * 강의 링크: https://egghead.io/lessons/react-create-an-entry-form-to-add-models-to-the-state-tree <br>8번째 레슨입니다. 위시 리스트에 새 항목을 추가 할 시간입니다. 우리는 지금까지 작성한 입력폼과 모델을 재사용할 것입니다. <br>우리는 다음을 배우게 됩니다. * MST는 단일 상태 트리(single state tree)로 제한되지 않습니다. 모든 모델은 자체적인 트리를 가질 수 있습니다 * 상태 트리(state tree)에 모델 인스턴스 추가하기 <br> *** <br><br> 새 파일 `WishListItemEntry.js`을 생성합니다. 여기서 **WishListItemEdit** 컴포넌트를 재활용합니다. 그리고 Add 버튼을 만들었습니다. 입력양식을 작성하고 Add 버튼을 누르면 WishList 모델에 새 항목을 추가하게 됩니다. `src/components/WishListItemEntry.js` ``` import React, { Component } from "react"; import { observer } from "mobx-react"; import WishListItemEdit from "./WishListItemEdit"; import { WishListItem, WishList } from "../models/WhishList"; class WishListItemEntry extends Component { constructor() { super(); this.state = { entry: WishListItem.create({ name: "", price: 0 }) }; } render() { return ( <div> <WishListItemEdit item={this.state.entry} /> <button onClick={this.onAdd}>Add</button> </div> ); } onAdd = () => { this.props.wishList.add(this.state.entry); this.setState({ entry: WishListItem.create({ name: "", price: 0 }) }); }; } export default WishListItemEntry; ``` <br><br> 그다음 `WishListView.js` 파일을 수정합니다. **WishListView** 컴포넌트에는 방금 만든 **WishListItemEntry** 컴포넌트를 추가하여 화면에 보여줍니다. `src/components/WishListView.js` ``` import React from "react"; import { observer } from "mobx-react"; import WishListItemView from "./WishListItemView"; import WishListItemEntry from './WishListItemEntry'; // add here const WishListView = ({ wishList }) => ( <div className="list"> <ul> {wishList.items.map((item, idx) => ( <WishListItemView key={idx} item={item} /> ))} </ul> Total: {wishList.totalPrice} 💲 <WishListItemEntry wishList={wishList} /> </div> ); export default observer(WishListView); ``` <br> <br> **실행화면** 이제 새로운 항목을 작성하고 Add 버튼을 눌러보세요. ***  *** <br>오늘 수업 끝. <br> <br> `댓글`, `팔로우`, `좋아요` 해 주시는 모든 분께 감사합니다. 항상 행복한 하루 보내시길 바랍니다. *** <center><img src='https://steemitimages.com/400x0/https://cdn.steemitimages.com/DQmQmWhMN6zNrLmKJRKhvSScEgWZmpb8zCeE2Gray1krbv6/BC054B6E-6F73-46D0-88E4-C88EB8167037.jpeg'><h5>vote, reblog, follow <code><a href='/@anpigon'>@anpigon</a></code></h5></center> *** <center><sup>Originally posted on [안피곤님의 블로그](http://anpigon.dblog.org/react-mobx-state-tree-8-create-an-entry-form-to-add-models-to-the-state-tree). Steem blog powered by [ENGRAVE](https://engrave.website).</sup></center>
author | anpigon |
---|---|
permlink | react-mobx-state-tree-8-create-an-entry-form-to-add-models-to-the-state-tree |
category | zzan |
json_metadata | {"format":"markdown","app":"engrave","tags":["zzan","kr","kr-dev","dev"],"image":["https://files.steempeak.com/file/steempeak/anpigon/sYISPibs-E1848CE185A6E18486E185A9E186A820E1848BE185A5E186B9E18482E185B3E186AB20E18483E185B5E1848CE185A1E1848BE185B5E186AB.png","https://files.steempeak.com/file/steempeak/anpigon/sYISPibs-E1848CE185A6E18486E185A9E186A820E1848BE185A5E186B9E18482E185B3E186AB20E18483E185B5E1848CE185A1E1848BE185B5E186AB.png","https://files.steempeak.com/file/steempeak/anpigon/fGBLZ36K-2019-08-252017-12-49.2019-08-252017_13_29.gif"],"links":["https://egghead.io/courses/manage-application-state-with-mobx-state-tree","https://egghead.io/lessons/react-create-an-entry-form-to-add-models-to-the-state-tree","https://steemitimages.com/400x0/https://cdn.steemitimages.com/DQmQmWhMN6zNrLmKJRKhvSScEgWZmpb8zCeE2Gray1krbv6/BC054B6E-6F73-46D0-88E4-C88EB8167037.jpeg'%3E%3Ch5%3Evote,"],"users":["@anpigon"],"engrave":{"domain":"anpigon.dblog.org","permlink":"react-mobx-state-tree-8-create-an-entry-form-to-add-models-to-the-state-tree","url":"https://anpigon.dblog.org/react-mobx-state-tree-8-create-an-entry-form-to-add-models-to-the-state-tree","featured_image":"https://files.steempeak.com/file/steempeak/anpigon/sYISPibs-E1848CE185A6E18486E185A9E186A820E1848BE185A5E186B9E18482E185B3E186AB20E18483E185B5E1848CE185A1E1848BE185B5E186AB.png","categories":["5d8b1dc94302ae00124415b9"]}} |
created | 2019-08-26 02:57:03 |
last_update | 2019-09-30 14:34:36 |
depth | 0 |
children | 6 |
last_payout | 2019-09-02 06:26:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.653 HBD |
curator_payout_value | 0.568 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 3,305 |
author_reputation | 17,258,940,000,931 |
root_title | "[React] Mobx-state-tree 학습하기 #8 : Create an Entry Form to Add Models to the State Tree" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,954,775 |
net_rshares | 4,740,891,693,955 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
guest123 | 0 | 882,090,591 | 100% | ||
busy.pay | 0 | 677,315,289,871 | 3.33% | ||
sisilafamille | 0 | 578,746,969 | 100% | ||
happyberrysboy | 0 | 24,543,629,775 | 100% | ||
hellosteem | 0 | 790,663,214 | 100% | ||
ai-channel | 0 | 698,737,983,309 | 19% | ||
stylegold | 0 | 543,201,740 | 100% | ||
virus707 | 0 | 219,742,513,531 | 1% | ||
realmankwon | 0 | 5,771,999,575 | 25% | ||
beoped | 0 | 72,656,800,306 | 33% | ||
dodoim | 0 | 2,867,290,685 | 100% | ||
fur2002ks | 0 | 163,717,221,437 | 12% | ||
forhappywomen | 0 | 49,262,464,234 | 100% | ||
omerbiabdulah | 0 | 488,489,799 | 100% | ||
krfeed | 0 | 279,164,862 | 100% | ||
pediatrics | 0 | 23,700,450,329 | 25% | ||
newsrx | 0 | 114,699,233 | 8.61% | ||
yjs3694 | 0 | 73,671,512,151 | 100% | ||
eversloth | 0 | 317,628,830,695 | 100% | ||
fun2learn | 0 | 1,215,693,962 | 2% | ||
philhyuntd | 0 | 2,644,514,543 | 50% | ||
sargoon | 0 | 373,894,511 | 4.3% | ||
rainingfall | 0 | 963,974,116 | 10% | ||
songbj | 0 | 1,530,310,102 | 100% | ||
stmdev | 0 | 64,677,641 | 2% | ||
rubberducky1004 | 0 | 184,068,446 | 100% | ||
limito | 0 | 1,345,148,432 | 100% | ||
tkhol | 0 | 43,688,498,989 | 100% | ||
andrewma | 0 | 0 | 0.2% | ||
blockchainstudio | 0 | 143,873,312,470 | 100% | ||
ziq | 0 | 420,879,255 | 100% | ||
anpigon | 0 | 15,725,812,495 | 100% | ||
newbijohn | 0 | 19,406,745,433 | 50% | ||
nailyourhome | 0 | 382,383,443 | 2.4% | ||
rokairforce | 0 | 1,820,395,142 | 100% | ||
ulockblock | 0 | 65,061,472,524 | 100% | ||
cn-news | 0 | 98,032,109 | 25% | ||
china-unicom | 0 | 97,850,687 | 25% | ||
china.mobile | 0 | 1,391,581,412 | 25% | ||
erke | 0 | 97,820,954 | 25% | ||
cnpc | 0 | 97,821,837 | 25% | ||
cn-times | 0 | 97,610,784 | 25% | ||
cn-reporter | 0 | 98,020,458 | 25% | ||
mcenoramle | 0 | 2,407,470,131 | 100% | ||
elraberscer | 0 | 1,101,141,871 | 100% | ||
bluengel | 0 | 28,966,497,192 | 10% | ||
laissez-faire | 0 | 81,523,960 | 100% | ||
reportup | 0 | 49,831,309,092 | 27% | ||
delegate4upvot | 0 | 84,347,493 | 1.6% | ||
imrahelk | 0 | 22,366,239,853 | 100% | ||
mco | 0 | 944,695,521 | 11% | ||
steem-ua | 0 | 420,951,740,001 | 8.61% | ||
honeybeerbear | 0 | 10,652,687,445 | 100% | ||
cazbu | 0 | 97,381,381 | 25% | ||
donasteem | 0 | 1,028,268,102 | 11.8% | ||
zyj | 0 | 97,381,381 | 25% | ||
fty | 0 | 97,360,832 | 25% | ||
gouji | 0 | 217,631,176 | 100% | ||
talken | 0 | 767,412,516 | 100% | ||
steemory | 0 | 3,108,355,252 | 100% | ||
pigoncchio | 0 | 565,519,243 | 100% | ||
maeil | 0 | 0 | 100% | ||
skysung | 0 | 349,740,624 | 50% | ||
j-car | 0 | 109,869,687,493 | 7% | ||
coredump | 0 | 100,013,341 | 10% | ||
son1001 | 0 | 840,095,175 | 100% | ||
minigame | 0 | 860,475,282,942 | 6% | ||
hakeznel | 0 | 538,051,936 | 100% | ||
stpeople | 0 | 395,182,429,693 | 7.1% | ||
roadofrich | 0 | 173,227,431,450 | 1.18% | ||
wangpigon | 0 | 1,134,384,599 | 100% | ||
lucky2.aaa | 0 | 415,969,838 | 100% | ||
lovelyyeon.cur | 0 | 729,499,107 | 100% | ||
nympheas | 0 | 414,309,159 | 100% | ||
zzan.biz | 0 | 1,513,132,077 | 100% | ||
zzan.adv | 0 | 431,443,511 | 25% | ||
zzan.co3 | 0 | 728,008,230 | 100% | ||
zzan.co7 | 0 | 365,036,745 | 100% | ||
zzan.co10 | 0 | 180,846,403 | 50% | ||
herobear | 0 | 177,126,166 | 100% | ||
kudock | 0 | 315,758,235 | 100% | ||
zzan.co13 | 0 | 162,854,351 | 50% | ||
zzan.co20 | 0 | 246,061,166 | 100% | ||
wonsama.zzan | 0 | 1,574,908,077 | 100% | ||
astraea09 | 0 | 376,102,689 | 100% | ||
zzangu | 0 | 2,394,704,992 | 50% | ||
realmankwon.scot | 0 | 901,747,361 | 100% | ||
hodolbak-zzan | 0 | 2,290,973,050 | 100% | ||
cn-sct | 0 | 999,500,307 | 2% | ||
gghite.zzan | 0 | 2,126,890,633 | 100% | ||
ror.pay | 0 | 308,266,840 | 1.18% | ||
windmolen | 0 | 1,835,883,414 | 100% | ||
boftea | 0 | 321,083,109 | 100% | ||
sct1004 | 0 | 678,764,344 | 25% | ||
hykwf678233 | 0 | 315,605,831 | 100% | ||
zzan1004 | 0 | 245,079,481 | 50% | ||
zzan.blue | 0 | 214,477,835 | 100% | ||
marlians.zzan | 0 | 1,570,019,258 | 100% |
#### Hi @anpigon! Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation! Your **UA** account score is currently 3.420 which ranks you at **#7424** across all Steem accounts. Your rank has not changed in the last three days. In our last Algorithmic Curation Round, consisting of 115 contributions, your post is ranked at **#20**. ##### Evaluation of your UA score: * You're on the right track, try to gather more followers. * The readers like your work! * Great user engagement! You rock! **Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
author | steem-ua |
---|---|
permlink | re-react-mobx-state-tree-8-create-an-entry-form-to-add-models-to-the-state-tree-20190828t122941z |
category | zzan |
json_metadata | "{"app": "beem/0.21.0"}" |
created | 2019-08-28 12:29:42 |
last_update | 2019-08-28 12:29:42 |
depth | 1 |
children | 0 |
last_payout | 2019-09-04 12:29:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 621 |
author_reputation | 23,214,230,978,060 |
root_title | "[React] Mobx-state-tree 학습하기 #8 : Create an Entry Form to Add Models to the State Tree" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 90,033,559 |
net_rshares | 0 |
 [kr-newbie](/@kr-newbie)님이 anpigon님을 멘션하셨습니당. 아래 링크를 누르시면 연결되용~ ^^ <br />[kr-newbie](/@kr-newbie)님의 [[8/26 kr-newbie 큐레이팅 프로젝트]](/zzan/@kr-newbie/8-26-kr-newbie) <br /> <blockquote>...b.io/#/wallet/kr-newbie happigon에서 자세한 임대내역이 확인 가능합니다. 만들어주신 anpigon께 감사드립니다! <ul> <li>anpigon님의 HAAPIGON 유저가이드를 참고해주시기 바랍니다!</...</blockquote>
author | steem.apps |
---|---|
permlink | re---------react-mobx-state-tree-8-create-an-entry-form-to-add-models-to-the-state-tree-20190826t065439119z |
category | zzan |
json_metadata | {"app":"steem.apps/0.1","format":"markdown"} |
created | 2019-08-26 06:54:39 |
last_update | 2019-08-26 06:54:39 |
depth | 1 |
children | 0 |
last_payout | 2019-09-02 06:54:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 414 |
author_reputation | 7,218,006,883,278 |
root_title | "[React] Mobx-state-tree 학습하기 #8 : Create an Entry Form to Add Models to the State Tree" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,960,257 |
net_rshares | 0 |
<center>[](https://steemitboard.com/@anpigon) **Congratulations @anpigon**! You raised your level and are now a **Dolphin**!</center> ###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!
author | steemitboard |
---|---|
permlink | steemitboard-notify-anpigon-20190826t110639000z |
category | zzan |
json_metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
created | 2019-08-26 11:06:39 |
last_update | 2019-08-26 11:06:39 |
depth | 1 |
children | 0 |
last_payout | 2019-09-02 11:06:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 406 |
author_reputation | 38,975,615,169,260 |
root_title | "[React] Mobx-state-tree 학습하기 #8 : Create an Entry Form to Add Models to the State Tree" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,966,649 |
net_rshares | 0 |
Hi, how are you doing? I have some tasks on Github related to the marlians.com tribe. I wonder if you will have time to take a look and perhaps help to carry it out. https://github.com/steem-engine-exchange/nitrous/issues/94 https://github.com/steem-engine-exchange/nitrous/issues/98 https://github.com/steem-engine-exchange/nitrous/issues/93 If you need to chat, you can find me here: https://discord.gg/Jjhrej3
author | surpassinggoogle |
---|---|
permlink | pwuwtk |
category | zzan |
json_metadata | {"tags":["zzan"],"links":["https://github.com/steem-engine-exchange/nitrous/issues/94","https://github.com/steem-engine-exchange/nitrous/issues/98","https://github.com/steem-engine-exchange/nitrous/issues/93","https://discord.gg/Jjhrej3"],"app":"steemit/0.1"} |
created | 2019-08-26 18:32:09 |
last_update | 2019-08-26 18:32:09 |
depth | 1 |
children | 1 |
last_payout | 2019-09-02 18:32:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 413 |
author_reputation | 527,661,560,108,742 |
root_title | "[React] Mobx-state-tree 학습하기 #8 : Create an Entry Form to Add Models to the State Tree" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,981,269 |
net_rshares | 0 |
I'm using Google Translator so it's hard to chat in English. So I can't help you much. but I can help this one. * https://github.com/steem-engine-exchange/nitrous/issues/93 <br> Just edit `src/app/components/pages/Grow.js` file <br>and add this code ``` import 'bootstrap/scss/bootstrap.scss' import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' ``` <br> like this.  <br> is it right? 
author | anpigon |
---|---|
permlink | pwvlpf |
category | zzan |
json_metadata | {"tags":["zzan"],"image":["https://cdn.steemitimages.com/DQmc2ELdoZvVS9LBH4gsFyenzBigbj46J2EYwhByuad1Ywk/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202019-08-27%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%2012.21.24.png","https://cdn.steemitimages.com/DQmP7DvGka1txMiQvQB5q6k1DF4Hkm1eCyrrsf9A46As1Xu/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202019-08-27%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%2012.25.46.png"],"links":["https://github.com/steem-engine-exchange/nitrous/issues/93"],"app":"steemzzang/0.1"} |
created | 2019-08-27 03:29:39 |
last_update | 2019-08-27 03:29:39 |
depth | 2 |
children | 0 |
last_payout | 2019-09-03 03:29:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 883 |
author_reputation | 17,258,940,000,931 |
root_title | "[React] Mobx-state-tree 학습하기 #8 : Create an Entry Form to Add Models to the State Tree" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,994,176 |
net_rshares | 0 |
Thank you for your continued support towards JJM. For each 1000 JJM you are holding, you can get an additional 1% of upvote. 10,000JJM would give you a 11% daily voting from the 700K SP virus707 account.
author | virus707 |
---|---|
permlink | re-react-mobx-state-tree-8-create-an-entry-form-to-add-models-to-the-state-tree-1566836653 |
category | zzan |
json_metadata | {"tags":["jjm"]} |
created | 2019-08-26 16:24:12 |
last_update | 2019-08-26 16:24:12 |
depth | 1 |
children | 0 |
last_payout | 2019-09-02 16:24:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 203 |
author_reputation | 557,563,606,581,756 |
root_title | "[React] Mobx-state-tree 학습하기 #8 : Create an Entry Form to Add Models to the State Tree" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 89,977,014 |
net_rshares | 0 |