Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
DevCoach 178: React | Teknik React Menghidupkan...
Search
Nad
December 01, 2024
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
DevCoach 178: React | Teknik React Menghidupkan UI dengan State
Nad
December 01, 2024
More Decks by Nad
See All by Nad
DevCoach 180: Back-End | Deploy Aplikasi dengan Aman dan Cepat Menggunakan CI/CD
nadiaaa22
0
100
DevCoach 179: Flutter | Ciptakan Animasi Epik dengan Animation
nadiaaa22
0
120
Dicoding Sharing Session: Unlocking the Machine Learning Workflow
nadiaaa22
0
120
DevCoach 176: React | Cara Jitu React Membangun UI
nadiaaa22
0
170
DevCoach 175: React | Kenalan dengan React: UI Web Masa Kini
nadiaaa22
0
100
DevCoach 174: Flutter | Bentangkan Sayap Kreativitasmu dengan Flutter Desktop
nadiaaa22
0
70
DevCoach 173: iOS | Mendalami SwiftUI, UI Framework Masa Depan!
nadiaaa22
0
160
DevCoach 172: Flutter | Tingkatkan Pengalaman Pengguna dengan Lokalisasi dan Aksesibilitas
nadiaaa22
0
130
DevCoach 171: Machine Learning in Google Cloud | Vertex AI di Google Cloud
nadiaaa22
0
310
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
1.6k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
360
Marketing to machines
jonoalderson
1
5.9k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
750
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
The Limits of Empathy - UXLibs8
cassininazir
2
720
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
600
Raft: Consensus for Rubyists
vanstee
142
7.8k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Transcript
Nur Rizki Adi Curriculum Developer Teknik React Menghidupkan UI dengan
State React
Todayʼs Topics • Class, The Legacy Component • Event Handling
• React Hooks • Pengenalan React DevTools React
React
Menangani UI Kompleks dan Terisolasi Bersifat Reusable Mengapa Harus React
Component? React
createElement, The React Legacy React import React from 'react'; const
element = React.createElement( 'h1', { id: 'my-title', className: 'text-red', }, 'Biodata Perusahaan', );
Nggak ada Bedanya dengan DOM Manipulation “Biasaˮ
HTML in JS const heading = React.createElement('h1', null, 'React'); const
strong = React.createElement('strong', null, 'best tool'); const paragraph = React.createElement('p', null, ['The ', strong, ' for building UI']) const divContainer = React.createElement('div', { className: 'container' }, [heading, paragraph]); const divContainer = ( <div className="container"> <h1>React</h1> <p>The <strong>best tool</strong> for building UI</p> </div> ); HTML in JS Version
Quiz #1 DevCoach 178 React
Quiz #1 DevCoach 178 Apa nama lain dari HTML in
JS?
Dua API untuk React Component Functional Class React
“Talk is cheap, Show me The Codeˮ Linus Torvalds
Strategi React Tree TodoList App
Component State React
Quiz #2 DevCoach 178 React
Quiz #2 DevCoach 178 Apa yang terjadi jika tombol “Ubahˮ
diklik?
Component State klik! Interaksi pengguna akan memperbarui state State merupakan
data di dalam component yang bila nilainya berubah component akan me-render ulang. Nilai state akan berubah ketika ada interaksi dari pengguna.
Implementasi Component State class Counter extends React.Component { constructor(props) {
super(props); // Inisialisasi state this.state = { count: 0 }; } onIncrease() { this.setState((prevState) => { return { count: prevState.count + 1 } }); } render() { return ( <div> <h1>{this.state.count}</h1> <button onClick={() => this.onIncrease()}> Increase </button> </div> ); } }
Props Drilling
Strategi React Tree TodoList App
State component hanya tersedia di Class Component! React Jika Tanpa
React Hooks
React Hook?
legacy.reactjs.org/docs/hooks-intro.html
Quiz #3 DevCoach 178 React
Apa yang terjadi jika tombol “Tambahˮ diklik? Quiz #3 DevCoach
178 React
Terima kasih nurrizkiadip Nur Rizki Adi Prasetyo NAdiprasetyo
[email protected]
Nur
Rizki Adi Prasetyo React
Feedback! dicoding.id/devcoachfeedback React
None