A walkthrough on how to mock local storage in Jest tests, as well as how to clear storage in jest tests. Example included.
Adding Google AdSense to a Gatsby Website. Lazy load the Google AdSense script to keep site speed fast. Examples and walk through in article.
Solution to using WordPress shortcodes in NextJS. Replace WordPress shortcode with React Component in NextJS simply.
How to mock a React component in a jest unit test. Example of how to mock a default or named component using React Testing Library.
Examples of how to use within in Jest and React Testing Library to target a specific section of the component. Restrict Jest queries to a particular element. Inside the context of a DOM node.
Using React MUI DatePicker dynamically lazy load date-fns locale files for localization. Reduce page size, speed up load time. Full working example and how to solution. Import locale files from date-fns.
Solution to using WordPress shortcodes in Gatsby. Replace WordPress shortcode with React Component in Gatsby simply. No MDX needed.
Tutorial for headless WordPress Gravity Forms with Gatsby Frontend. Step by step guide to rendering forms as React Components and handling submissions.
Updating React Material UI Core causes error: 'Failed prop type: The prop `disableBackdropClick` of `ForwardRef(Dialog)` is deprecated' - SOLVED! With example.