How to Embed a React App in a CakePHP 4 view template and configure React App and CakePHP 4 for React development
Code: https://github.com/toggenation/embed-...
Video Timings
00:00 Intro
01:12 Creating ReactEmbed Component with bake
02:07 Creating a Controller with bake
03:11 Create an action in Controller
04:14 Create a template file
05:20 Configuring routes
06:30 Install React App using Create React App
08:37 Run a React Production Build
09:19 Deploy React App to CakePHP 4 webroot/
11:30 Sourcing asset-manifest.json to create embed logic
13:00 View CakePHP constants in DebugKit Environment Panel
13:30 Write logic for CSS and JS entrypoints
15:50 Using CakePHP 4 Collection::reduce() method
19:53 Configure CSS and JS script tags in template
20:43 Fix script loading before root div error
20:30 Modify layout to add entrypoint script to custom block
23:12 Fix logo not loading using package.json homepage property
24:50 Configure dev/prod React to request data from CakePHP
29:30 Create dummy api endpoint
31:40 Using ServerRequest::is('ajax')
35:00 Make a fetch request from React
35:58 Setting headers for fetch request
39:20 Adding Cors Middleware
42:17 Stopping useEffect running too many times
46:36 Using npm version patch to version React builds
On this page of the site you can watch the video online CakePHP 4 - Embedding a Create React App in a View (Development Setup) with a duration of hours minute second in good quality, which was uploaded by the user James McDonald 14 August 2022, share the link with friends and acquaintances, this video has already been watched 1,936 times on youtube and it was liked by 41 viewers. Enjoy your viewing!