これからはじめるReact Hooks

2917a3c430817eb71086f8973c06ebba?s=47 sakito
September 03, 2019

これからはじめるReact Hooks

2917a3c430817eb71086f8973c06ebba?s=128

sakito

September 03, 2019
Tweet

Transcript

  1. ͜Ε͔Β͸͡ΊΔ3FBDU)PPLT #POpSF'SPOUFOEd࠷৽ͷϑϩϯτΤϯυٕज़ʢՆٳΈ૯෮शʣd

  2. /BNF 4BLJUP.VLBJ 5XJUUFS
 !@@TBLJUP@@ $PNQBOZ $ZCP[VJOD
 'SPOUFOE&YQFSU5FBN "CPVUNF

  3. w3FBDU)PPLTͱ͸ʁ wVTF4UBUFͱVTF&⒎FDU w$VTUPN)PPLT w3VMFTPG)PPLTͱ&4-JOU1MVHJO w3FBDU)PPLT5FTU "HFOEB

  4. 3FBDU)PPLTͱ͸ʁ

  5. w3FBDUW͔Β৽͘͠௥Ճ͞Εͨػೳ w$MBTTDPNQPOFOUTΛ࢖༻͢Δ͜ͱͳ͘ɺ
 ؔ਺ίϯϙʔωϯτͰ༷ʑͳ"1*Λ࢖͑Δ w3FOEFSQSPQT΍)P$ͳͲΛ࢖༻͠ͳͯ͘΋
 ϩδοΫͷ෼཭͕Մೳʹͳͬͨ wݱࡏ͸$MBTTDPNQPOFOU͕࡟আ͞ΕΔΘ͚Ͱ͸ͳ͘ɺ
 ஈ֊తʹҠߦ͕Մೳ wഁյతมߋ͸ؚ·Εͳ͍ 3FBDU)PPLTͱ͸ʁ

  6. w -JGFDZDMF΍4UBUFͷϩδοΫΛ࠶ར༻͔ͨͬͨ͠ w ͦͷͨΊSFOEFSQSPQT΍)P$ͱ͍͏ख๏Λ࢖͍ͬͯͨ w ͔͠͠ɺ͜ͷख๏͸ίϯϙʔωϯτ֊૚͕ॏͳΓ
 ϥούʔ஍ࠈͱͳΓಡΈʹ͍͘໰୊఺͕͋ͬͨ w ͦ͜Ͱɺίϯϙʔωϯτ֊૚ͳͲʹґଘͤͣɺ
 ϩδοΫΛ࢖͍ճͤΔΑ͏ʹ)PPL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U'VODUJPO$PNQPOFOUͷ৔߹  w ୈೋҾ਺Λࢦఆ EFQT  w ͜ͷͱ͖EFQTʹࢦఆ͞Εͨ஋ ͜ͷ৔߹͸ʮZFBSʯ ͕ൺֱ͞Εɺ


    มߋ͕͋Δ৔߹ͷΈɺಈ࡞͢Δ
  21. VTF&⒎FDU'VODUJPO$PNQPOFOUͷ৔߹  EFQTΛؒҧ͏ͱൺֱର৅͕ͳ͍ͷͰɺߋ৽͞Εͳ͍ͷͰ஫ҙ

  22. VTF&⒎FDU'VODUJPO$PNQPOFOUͷ৔߹  ؔ਺Λฦ٫͢Δ͜ͱͰɺDMFBOVQΛߦ͏͜ͱ͕Ͱ͖Δ

  23. ࣮૷Λݟͳ͕ΒॲཧΛ௥͏

  24. None
  25. ϩʔσΟϯάදࣔޙɺऔಘ৘ใΛදࣔ

  26. VTF4UBUFͰॳظ஋ͱTFUؔ਺Λఆٛ

  27. ֤TUBUFΛߋ৽

  28. w63-͸มߋ͞Εͳ͍ͷͰɺ
 ॳظϨϯμϦϯάޙͷΈ
 HFU"SUJDMF ͕ൃՐ͢Δ

  29. ϩʔσΟϯάදࣔޙɺऔಘ৘ใΛදࣔ

  30. $VTUPNIPPLT

  31. ͜ͷ··Ͱ͸7JFXͱϩδοΫ͕ಉ͡Օॴʹ

  32. None
  33. ϩδοΫͷΈ

  34. WJFXͷΈ

  35. ͞Βʹৄ͍͠಺෦ͷ͜ͱ΋஌Γ͍ͨਓ IUUQTEFWUPEBO@BCSBNPWNBLJOHTFOTFPGSFBDUIPPLTFJC

  36. ͦͷଞͷ)PPLT"1* IUUQTSFBDUKTPSHEPDTIPPLTSFGFSFODFIUNM

  37. 3VMFTPG)PPLTͱ&4-JOU1MVHJO

  38. w)PPLTΛѻ͏ࡍʹ͸ɺ͍͔ͭ͘஫ҙ͢Δඞཁ͕͋Δ w$VTUPN)PPLT͔3FBDU)PPLTͷதͰͷΈݺͼग़͢ wϧʔϓɺ৚݅಺ɺωετ͞Εͨؔ਺಺Ͱ࢖Θͳ͍ 3VMFTPG)PPLT

  39. 3VMFTPG)PPLT

  40. w)PPLTͷ3VMFTʹԊΘͳ͍৔߹͸FSSPSʹ wVTF&⒎FDUͷEFQT͕ޡͬͯΔ৔߹͸XBSOʹ &4-JOU1MVHJOFTMJOUQMVHJOSFBDUIPPLT 

  41. 3FBDU)PPLT5FTU

  42. SFBDUIPPLTUFTUJOHMJCSBSZ IUUQTHJUIVCDPNUFTUJOHMJCSBSZSFBDUIPPLTUFTUJOHMJCSBSZ

  43. SFBDUIPPLTUFTUJOHMJCSBSZ IUUQTHJUIVCDPNUFTUJOHMJCSBSZSFBDUIPPLTUFTUJOHMJCSBSZ

  44. )PXUPUFTUDPNQPOFOUTUIBUVTF)PPLT IUUQTSFBDUKTPSHEPDTIPPLTGBRIUNMIPXUPUFTUDPNQPOFOUTUIBUVTFIPPLT

  45. ·ͱΊ

  46. ·ͱΊ w໌೔͔Β3FBDU)PPLTΛ࢖͍ͬͯ͜͏ʂ w5ZQF4DSJQUͱͷ૬ੑ΋͍͍ w$VTUPN)PPLTͷϥΠϒϥϦ͸ͨ͘͞Μ͋Δɺ
 ࣮૷Λࢀߟʹͯ࢝͠Ί͍͚ͯΔ w·ͣ͸ެࣜυΩϡϝϯτಡΉɺ'"2΋ॆ࣮͍ͯ͠Δ

  47. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠