Toggen Blog
Tech tips
Articles
Latest
Embedding ReactJS in a CakePHP View
When people say they want to use CakePHP with React typically the recommendation is to convert CakePHP into an API server and then add ReactJS as the front-end served on a different URL than CakePHP. But what about when you have a CakePHP application and you...
NextJS + Redux Testing
Been trying to implement some tests for NextJS Redux App. You can get most of the way there by following the very good information here => http://redux.js.org/recipes/writing-tests But if you drop .babelrc into your NextJS project as per above it stops the npm run...
Javascript Tips: Scope your case blocks with curly brackets
Give your react props default values If you pass null as a prop then you get warnings about going from a controlled to uncontrolled component Renaming variables when...
Dealing with Flashes of Unstyled Content in NextJS
So I made a YouTube video of a challenge I had of a FontawesomeIcon React component flashing to massive when loading the page and then back to the right size. This video shows the work-a-rounds. I tried to include the code snippets here but the self hosted wordpress...
Working around SVG Swallowing Click Events
I have used FortAwesome/react-fontawesome to put a trash icon on a nextjs react page. <a data-part_id={id} data-meeting_id={meetingId} onClick={(e) => { e.preventDefault(); console.log(event.target) window.confirm('Do you really want to...
CakePHP 3 returning invalid sort order
CakePHP with a query string /api/parts/getParts?sort=sort_order&direction=asc&limit=100 Returns items out of order. See below for the work-a-round { "parts": [ { "sort_order": 10 }, { "sort_order": 20 }, {...
