Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
React for Gutenberg, WordPress & Beyond - WordC...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Zac Gordon
October 06, 2018
Technology
270
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
React for Gutenberg, WordPress & Beyond - WordCamp Baltimore 2018
Zac Gordon
October 06, 2018
More Decks by Zac Gordon
See All by Zac Gordon
How We Can Make WordPress Better for the JAMstack
zgordon
0
340
Decoupled Days - JAMstack and WordPress for 2020
zgordon
0
200
The State of JavaScript and WordPress in 2020
zgordon
0
970
100 Things to Know About Building, Selling and Supporting Online Courses and Content
zgordon
0
690
Highly Dynamic WordPress Sites with Gatsby and WordPress
zgordon
0
1k
How the New Redux Based Data API is Changing Everything in WordPress*
zgordon
0
420
The Data API in WordPress - WCMIA 2019
zgordon
0
1.1k
Building Custom WordPress Blocks with React - WCPHX 2019
zgordon
0
94
WordCamp Seattle 2017 JavaScript Workshop
zgordon
0
1.1k
Other Decks in Technology
See All in Technology
Reliability in the Age of AI: Engineering for AI Velocity
rrreeeyyy
0
120
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
1.9k
2026TECHFRESH畢業分享會 - 葬送的通靈師:化系統與用戶雜訊成行動訊號
line_developers_tw
PRO
0
670
Kubernetesにおける学習基盤とLLMOpsの概要
ry
1
230
2026 TECHFRESH 畢業分享會 - AI-Native 重塑軟體工程與虛擬講師
line_developers_tw
PRO
0
670
MIERUNE JCT 発表資料「宇宙から伊能忠敬ごっこ」
syuchimu
0
200
2026TECHFRESH畢業分享會 - Lightning Talk - 資料也要 CI/CD? 用 Airbyte 自動化資料同步
line_developers_tw
PRO
0
660
価格.comをAI駆動で全面刷新する ー 30年分の技術的負債を返し、次の30年の土台をつくる ー / AI Engineering Summit Tokyo 2026
tkyowa
53
59k
LLMにもCAP定理があるという話
harukasakihara
0
280
新しいVibe Codingと”自走”について
watany
5
290
個人最適 から 全体最適 へ AI情報共有会・AIギルド・AI-DLC で進める カンリーの組織展開
rfdnxbro
0
2.2k
2026.06.13_AI時代に事業会社が「SIer出身エンジニア」を求める理由 / Why Businesses Seek Engineers with a System Integrator Background in the AI Era
jumtech
0
1k
Featured
See All Featured
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
560
Thoughts on Productivity
jonyablonski
76
5.2k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.5k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
190
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
380
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
300
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
210
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
380
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
160
Practical Orchestrator
shlominoach
191
11k
Transcript
javascriptforwp.com/bmore @zgordon React for Gutenberg, WordPress & Beyond w Zac
Gordon
javascriptforwp.com/bmore @zgordon Hi! I’m Zac zacgordon.com
javascriptforwp.com/bmore @zgordon How & Why React is Included w WordPress
javascriptforwp.com/bmore @zgordon A bit of history..
javascriptforwp.com/bmore @zgordon Gutenberg is React Under the Hood
javascriptforwp.com/bmore @zgordon Built Decoupled Wired to WordPress
@zgordon javascriptforwp.com/bmore gutenberg-standalone.surge.sh
@zgordon javascriptforwp.com/bmore drupalgutenberg.org
javascriptforwp.com/bmore @zgordon Gutenberg Editor is a Modern React App
@zgordon javascriptforwp.com/bmore npmjs.com/~WordPress
@zgordon javascriptforwp.com/bmore
javascriptforwp.com/bmore @zgordon Better Standards for WordPress JavaScript
@zgordon javascriptforwp.com/bmore github.com/WordPress-Coding-Standards/eslint-plugin-wordpress
javascriptforwp.com/bmore @zgordon Gutenberg Editor is a Modern React App
javascriptforwp.com/bmore @zgordon React in WordPress
javascriptforwp.com/bmore @zgordon The Great WordPress React Abstraction
@zgordon // Enqueue JS - React Dependency? wp_enqueue_script( 'myplugin-js', plugins_url(
null, __FILE__ ) . '/js/plugin.js', [ 'jquery' ] );
@zgordon // Enqueue JS - React Dependency? wp_enqueue_script( 'myplugin-js', plugins_url(
null, __FILE__ ) . '/js/plugin.js', [ 'react' ] );
@zgordon javascriptforwp.com/bmore In WordPress React == wp.element
@zgordon javascriptforwp.com/bmore github.com/WordPress/gutenberg/tree/master/packages/element
@zgordon javascriptforwp.com/bmore The Great WordPress React Abstraction
@zgordon // Normal React const el = React.createElement('h1', null, 'Welcome!');
// WordPress React const el = wp.element.createElement('h1', null, 'Welcome!');
@zgordon // Normal ReactDOM ReactDOM.render( el, document.getElementById( 'root' ) );
// WordPress ReactDOM wp.element.render( el, document.getElementById( ‘root' ) );
@zgordon javascriptforwp.com/bmore wp.element is Available in the DOM window object*
window.wp.element
@zgordon javascriptforwp.com/bmore gutenberg.local
@zgordon // WordPress React - Normal const el = wp.element.createElement('h1',
null, 'Welcome!'); // WordPress React - Destructured const { createElement } = wp.element; const el = createElement('h1', null, 'Welcome!');
javascriptforwp.com/bmore @zgordon To Use React Outside of Gutenberg
@zgordon // Enqueue JS - React Dependency? wp_enqueue_script( 'myplugin-js', plugins_url(
null, __FILE__ ) . '/js/plugin.js', [ 'wp-element' ] );
@zgordon javascriptforwp.com/bmore gutenberg.local
javascriptforwp.com/bmore @zgordon We Also Have JSX In WordPress
@zgordon <PanelBody> <TextControl label={ __( 'Text Field', 'domain' ) }
value={ textControl } onChange={ textControl =>" setAttributes( { textControl } ) } /> </PanelBody> <PanelBody> <TextareaControl label={ __( 'Text Area Field', 'domain' ) } value={ textareaControl } onChange={ textareaControl =>" setAttributes( { textareaControl } ) } /> </PanelBody>
@zgordon javascriptforwp.com/bmore You will need Babel to use JSX..
@zgordon javascriptforwp.com/bmore npmjs.com/package/@wordpress/babel-preset-default
@zgordon javascriptforwp.com/bmore npmjs.com/package/@wordpress/babel-plugin-import-jsx-pragma
@zgordon <PanelBody> <TextControl label={ __( 'Text Field', 'domain' ) }
value={ textControl } onChange={ textControl =>" setAttributes( { textControl } ) } /> <TextareaControl label={ __( 'Text Area Field', 'domain' ) } value={ textareaControl } onChange={ textareaControl =>" setAttributes( { textareaControl } ) } /> </PanelBody>
javascriptforwp.com/bmore @zgordon A React Component Library For WordPress!
@zgordon javascriptforwp.com/bmore wp.components
@zgordon const { Autocomplete, Button, CheckboxControl, ColorPalette, DropZone, FormToggle, Panel,
Popover, Spinner, TextControl, TextareaControl, Tooltip, } = wp.components; const CustomTooltip = () =>" ( <Tooltip text="More Info"> <Button isDefault> Hover for Tooltip </Button> </Tooltip> );
javascriptforwp.com/bmore @zgordon Redux in WordPress
@zgordon javascriptforwp.com/bmore github.com/WordPress/gutenberg/tree/master/packages/data#comparison-with-redux
@zgordon javascriptforwp.com/bmore Ability to Create Our Own Data Stores Using
WP Redux
@zgordon javascriptforwp.com/bmore github.com/WordPress/gutenberg/tree/master/packages/core-data
@zgordon javascriptforwp.com/bmore Use Data API Instead Of Your Own WP
REST API Calls *
@zgordon const { withSelect, withDispatch, } = wp.data;
@zgordon const { withSelect } = wp.data; function MyAuthorsListBase( {
authors } ) { return ( <ul> { authors.map( ( author ) =>" ( <li key={ author.id }>{ author.name }</li> ) ) } </ul> ); } const MyAuthorsList = withSelect( ( select ) =>" ( { authors: select( 'core' ).getAuthors(), } ) )( MyAuthorsListBase );
@zgordon const { withSelect } = wp.data; function MyPostsListBase( {
posts } ) { return ( <ul> { posts.map( ( post ) =>" ( <li key={ post.id }>{ post.title.rendered }</li> ) ) } </ul> ); } const MyPostList = withSelect( ( select ) =>" ( { posts: select( 'core' ).getEntityRecords( 'postType', 'post', { per_page: 5 } ) } ) )( MyPostsListBase );
@zgordon edit: withSelect( select =>" { return { posts: select(
'core' ).getEntityRecords( 'postType', 'post', { per_page: 5 } ) }; } )( ( { posts } ) =>" { return ( <ul> { posts.map( post =>" { return <li>{ post.title.rendered }</li>; }) } </ul> ); } )
@zgordon javascriptforwp.com/bmore npmjs.com/package/@wordpress/api-fetch
javascriptforwp.com/bmore @zgordon React in WP Immediate Future vs. Next Few
Years
javascriptforwp.com/bmore @zgordon Gutenberg “Block” Editor
javascriptforwp.com/bmore @zgordon Gutenberg “Block” Editor, Widgets, Customizer, Themes, Plugins, Decoupled
javascriptforwp.com/bmore @zgordon Do I Need to Learn All of This?
javascriptforwp.com/bmore @zgordon 20% OFF Gutenberg Course javascriptforwp.com/bmore Q&A