{"id":9362,"date":"2025-04-04T12:21:57","date_gmt":"2025-04-04T10:21:57","guid":{"rendered":"https:\/\/kabisa.nl\/?p=9362"},"modified":"2025-04-04T12:25:25","modified_gmt":"2025-04-04T10:25:25","slug":"more-efficient-code-with-the-react-compiler","status":"publish","type":"post","link":"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/","title":{"rendered":"More efficient code with the React Compiler"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"9362\" class=\"elementor elementor-9362\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-30a02df4 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"30a02df4\" data-element_type=\"section\" data-e-type=\"section\" data-settings=\"{&quot;jet_parallax_layout_list&quot;:[]}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3cd33cc4\" data-id=\"3cd33cc4\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-3beeb824 elementor-widget elementor-widget-text-editor\" data-id=\"3beeb824\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3>The React Compiler, is a build-time tool designed to automatically optimize React applications by handling memoization and reducing unnecessary re-renders. This compiler, formerly known as React Forget, was first introduced at React Conf in 2021.<\/h3>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t<div class=\"elementor-element elementor-element-4d626cf e-con-full e-flex e-con e-parent\" data-id=\"4d626cf\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;jet_parallax_layout_list&quot;:[]}\">\n\t\t\t\t<div class=\"elementor-element elementor-element-496bf80 elementor-widget elementor-widget-text-editor\" data-id=\"496bf80\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h2>What Does It Do Exactly?<\/h2><p><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">The primary function of the React Compiler is to automate the memoization process in React applications. Memoization is an optimization technique where the results of expensive function calls are cached so that subsequent calls with the same arguments can return the cached result, improving performance. React offers hooks like <\/span><span style=\"font-size: 11pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">useMemo<\/span><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">, <\/span><span style=\"font-size: 11pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">useCallback<\/span><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">, and higher-order components like <\/span><span style=\"font-size: 11pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">React.memo<\/span><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"> to manually handle memoization. However, these manual methods can be error-prone and challenging to maintain. Especially if you want to prevent unnecessary rerenders of child components. The React Compiler addresses this by automatically analyzing the code and applying memoization where necessary, ensuring that components re-render only when their inputs change.<\/span><\/p><h2>How to use it today?<\/h2><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 12pt; margin-bottom: 12pt;\"><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">To integrate the React Compiler into your project, follow these steps:<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Check Compatibility<\/span><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">: Before installation, it&#8217;s advisable to assess your codebase&#8217;s compatibility with the React Compiler. Run the following command:<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><br \/><\/span><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">npx react-compiler-healthcheck@latest<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: 'Roboto Mono',monospace; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><br \/><\/span><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">or, if you are using yarn:<\/span><\/p><p>\u00a0<\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">yarn dlx react-compiler-healthcheck@latest<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 12pt; margin-bottom: 12pt;\"><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">This script evaluates how many components in your project can be optimized by the compiler and checks for any incompatible libraries.<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 12pt; margin-bottom: 12pt;\"><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Output looks like this:<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.2; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Successfully compiled 46 out of 52 components.<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.2; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">StrictMode usage found.<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.2; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Found no usage of incompatible libraries.<\/span><\/p><p>\u00a0<\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: bold; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Install the Compiler and ESLint Plugin<\/span><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">: If your project is compatible, proceed to install the React Compiler and its accompanying ESLint plugin:<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><br \/><\/span><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">npm install -D babel-plugin-react-compiler@beta eslint-plugin-react-compiler@beta<\/span><\/p><p>\u00a0<\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">or, if you are using yarn:<\/span><\/p><p>\u00a0<\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">yarn add -D babel-plugin-react-compiler@beta eslint-plugin-react-compiler@beta<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 12pt; margin-bottom: 12pt;\"><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">The ESLint plugin provides real-time feedback in your code editor, highlighting areas where the compiler&#8217;s optimizations apply.<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 12pt; margin-bottom: 12pt;\"><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">It mainly checks if your code violates <\/span><a style=\"text-decoration: none;\" href=\"https:\/\/react.dev\/reference\/rules\"><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #1155cc; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: underline; -webkit-text-decoration-skip: none; text-decoration-skip-ink: none; vertical-align: baseline; white-space: pre-wrap;\">the rules of React.<\/span><\/a><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Next step, if you are using Vite, update the configuration of the React plugin:<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Arial,sans-serif; color: #000000; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><br \/><\/span><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">const ReactCompilerConfig = {<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0\u00a0\/* In my case, I left this empty *\/<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">};<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\/\/ https:\/\/vitejs.dev\/config\/<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">export default defineConfig({<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0\u00a0plugins: [<\/span><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><br \/><\/span><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0 \u00a0 react({<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0babel: {<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0plugins: [[&#8220;babel-plugin-react-compiler&#8221;, ReactCompilerConfig]]<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0\u00a0\u00a0\u00a0}),<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0\u00a0\u00a0\u00a0\/\/ \u2026<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">\u00a0\u00a0],<\/span><\/p><p dir=\"ltr\" style=\"line-height: 1.38; margin-left: 36pt; margin-top: 0pt; margin-bottom: 0pt;\"><span style=\"font-size: 11pt; font-family: Consolas,sans-serif; color: #188038; background-color: transparent; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">});<\/span><\/p><h2>How to test if it works?<\/h2><p>If you are using the <a href=\"https:\/\/react.dev\/learn\/react-developer-tools#browser-extension\">React developer tools<\/a> plugin for your browser, and you inspect your component tree, you will see that most of the components now have a [ Memo \u2728 ] mark.<\/p><table><tbody><tr><td><p>Without the React Compiler:<\/p><p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-9370 size-large\" src=\"http:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/React-without-compiler-801x1024.png\" alt=\"\" width=\"800\" height=\"1023\" srcset=\"https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/React-without-compiler-801x1024.png 801w, https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/React-without-compiler-235x300.png 235w, https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/React-without-compiler-768x982.png 768w, https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/React-without-compiler.png 1056w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p><\/td><td><p>With the React Compiler:<\/p><p><img decoding=\"async\" class=\"alignnone size-large wp-image-9368\" src=\"http:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/React-with-compiler-769x1024.png\" alt=\"\" width=\"769\" height=\"1024\" srcset=\"https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/React-with-compiler-769x1024.png 769w, https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/React-with-compiler-225x300.png 225w, https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/React-with-compiler-768x1023.png 768w, https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/React-with-compiler.png 1014w\" sizes=\"(max-width: 769px) 100vw, 769px\" \/><\/p><\/td><\/tr><\/tbody><\/table><h2>Benefits<\/h2><p>I was hoping that the React compiler would make my application faster. Not that it was slow, but extended use (as a mobile PWA game) was quite taxing on the battery.<\/p><p>After enabling the React compiler, I measured the render time in the profiler, and the render time was <b>halved<\/b>! Even though the compiler is still in beta, the benefits are really noticeable.<\/p><p>Render time <strong>without<\/strong> React Compiler:<\/p><p><img decoding=\"async\" class=\"alignnone size-large wp-image-9374\" src=\"http:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/Render-time-without-react-compiler-1024x314.png\" alt=\"\" width=\"800\" height=\"245\" srcset=\"https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/Render-time-without-react-compiler-1024x314.png 1024w, https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/Render-time-without-react-compiler-300x92.png 300w, https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/Render-time-without-react-compiler-768x235.png 768w, https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/Render-time-without-react-compiler.png 1282w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p><p>Render time <strong>with<\/strong> React Compiler:<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-9372\" src=\"http:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/Render-time-with-react-compiler-1024x229.png\" alt=\"\" width=\"800\" height=\"179\" srcset=\"https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/Render-time-with-react-compiler-1024x229.png 1024w, https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/Render-time-with-react-compiler-300x67.png 300w, https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/Render-time-with-react-compiler-768x172.png 768w, https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/Render-time-with-react-compiler-1536x344.png 1536w, https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/Render-time-with-react-compiler.png 1600w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/p><p>Same amount of actions took 3.6ms of rendertime, while it was 7.3ms without the compiler<\/p><p>And the nice thing is that all these memoizations are not part of the codebase, keeping the code readable and focussed on features. All these wrappings of memoization made the bundler a bit bigger, (about 20k) but that was a really small price to pay for the performance gains.<\/p><p>I think the compiler is a great success and I am really curious what further optimizations will be added in the compiler. The beta so far has been great!<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>The React Compiler, is a build-time tool designed to automatically optimize React applications by handling memoization and reducing unnecessary re-renders. This compiler, formerly known as React Forget, was first introduced at React Conf in 2021. What Does It Do Exactly? The primary function of the React Compiler is to automate the memoization process in React [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":9359,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[149],"tags":[],"class_list":["post-9362","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.4 (Yoast SEO v28.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>More efficient code with the React Compiler | Kabisa Software Artisans<\/title>\n<meta name=\"description\" content=\"The React Compiler, is a build-time tool designed to automatically optimize React applications by handling memoization and reducing unnecessary re-renders. This compiler, formerly known as React Forget, was first introduced at React Conf in 2021.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"More efficient code with the React Compiler | Kabisa Software Artisans\" \/>\n<meta property=\"og:description\" content=\"The React Compiler, is a build-time tool designed to automatically optimize React applications by handling memoization and reducing unnecessary re-renders. This compiler, formerly known as React Forget, was first introduced at React Conf in 2021.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/\" \/>\n<meta property=\"og:site_name\" content=\"Kabisa Software Artisans\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/kabisaict\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-04T10:21:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-04T10:25:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/The-React-Compiler.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1536\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Matthijs Groen\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Matthijs Groen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"More efficient code with the React Compiler | Kabisa Software Artisans","description":"The React Compiler, is a build-time tool designed to automatically optimize React applications by handling memoization and reducing unnecessary re-renders. This compiler, formerly known as React Forget, was first introduced at React Conf in 2021.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/","og_locale":"en_US","og_type":"article","og_title":"More efficient code with the React Compiler | Kabisa Software Artisans","og_description":"The React Compiler, is a build-time tool designed to automatically optimize React applications by handling memoization and reducing unnecessary re-renders. This compiler, formerly known as React Forget, was first introduced at React Conf in 2021.","og_url":"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/","og_site_name":"Kabisa Software Artisans","article_publisher":"https:\/\/www.facebook.com\/kabisaict","article_published_time":"2025-04-04T10:21:57+00:00","article_modified_time":"2025-04-04T10:25:25+00:00","og_image":[{"width":1536,"height":1024,"url":"https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/The-React-Compiler.png","type":"image\/png"}],"author":"Matthijs Groen","twitter_misc":{"Written by":"Matthijs Groen","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/#article","isPartOf":{"@id":"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/"},"author":{"name":"Matthijs Groen","@id":"https:\/\/kabisa.nl\/en\/#\/schema\/person\/26bfc7d2180be651ae6e406c91401f41"},"headline":"More efficient code with the React Compiler","datePublished":"2025-04-04T10:21:57+00:00","dateModified":"2025-04-04T10:25:25+00:00","mainEntityOfPage":{"@id":"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/"},"wordCount":561,"commentCount":0,"publisher":{"@id":"https:\/\/kabisa.nl\/en\/#organization"},"image":{"@id":"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/#primaryimage"},"thumbnailUrl":"https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/The-React-Compiler.png","articleSection":["Tech blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/","url":"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/","name":"More efficient code with the React Compiler | Kabisa Software Artisans","isPartOf":{"@id":"https:\/\/kabisa.nl\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/#primaryimage"},"image":{"@id":"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/#primaryimage"},"thumbnailUrl":"https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/The-React-Compiler.png","datePublished":"2025-04-04T10:21:57+00:00","dateModified":"2025-04-04T10:25:25+00:00","description":"The React Compiler, is a build-time tool designed to automatically optimize React applications by handling memoization and reducing unnecessary re-renders. This compiler, formerly known as React Forget, was first introduced at React Conf in 2021.","breadcrumb":{"@id":"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/#primaryimage","url":"https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/The-React-Compiler.png","contentUrl":"https:\/\/kabisa.nl\/wp-content\/uploads\/2025\/04\/The-React-Compiler.png","width":1536,"height":1024,"caption":"The React Compiler"},{"@type":"BreadcrumbList","@id":"https:\/\/kabisa.nl\/en\/insights\/more-efficient-code-with-the-react-compiler\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kabisa.nl\/en\/"},{"@type":"ListItem","position":2,"name":"Insights","item":"https:\/\/kabisa.nl\/en\/insights\/"},{"@type":"ListItem","position":3,"name":"More efficient code with the React Compiler"}]},{"@type":"WebSite","@id":"https:\/\/kabisa.nl\/en\/#website","url":"https:\/\/kabisa.nl\/en\/","name":"Kabisa Software Artisans","description":"Mission-critical Software for Hightech, Fintech &amp; E-commerce","publisher":{"@id":"https:\/\/kabisa.nl\/en\/#organization"},"alternateName":"Kabisa","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kabisa.nl\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kabisa.nl\/en\/#organization","name":"Cloud Legends","alternateName":"Kabisa","url":"https:\/\/kabisa.nl\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kabisa.nl\/en\/#\/schema\/logo\/image\/","url":"https:\/\/kabisa.nl\/wp-content\/uploads\/2022\/12\/kabisa-favicon.png","contentUrl":"https:\/\/kabisa.nl\/wp-content\/uploads\/2022\/12\/kabisa-favicon.png","width":512,"height":512,"caption":"Cloud Legends"},"image":{"@id":"https:\/\/kabisa.nl\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/kabisaict","https:\/\/x.com\/kabisasoftware"],"description":"Software Development is onze core-business. Kabisa ontwikkelt innovatieve maatwerk software die naadloos aansluit bij de behoeftes van klanten en eindgebruikers. Dat doen we in nauwe samenwerking in elke fase van het proces: co-creatie noemen we dat.","email":"info@kabisa.nl","telephone":"0495 430 798","legalName":"Kabisa B.V.","foundingDate":"2006-01-01","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"51","maxValue":"200"}},{"@type":"Person","@id":"https:\/\/kabisa.nl\/en\/#\/schema\/person\/26bfc7d2180be651ae6e406c91401f41","name":"Matthijs Groen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/991e323a3492d8b217feb923ce12d6ef2567ac8447838ec09a1c70775dd2c522?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/991e323a3492d8b217feb923ce12d6ef2567ac8447838ec09a1c70775dd2c522?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/991e323a3492d8b217feb923ce12d6ef2567ac8447838ec09a1c70775dd2c522?s=96&d=mm&r=g","caption":"Matthijs Groen"}}]}},"_links":{"self":[{"href":"https:\/\/kabisa.nl\/en\/wp-json\/wp\/v2\/posts\/9362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kabisa.nl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kabisa.nl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kabisa.nl\/en\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/kabisa.nl\/en\/wp-json\/wp\/v2\/comments?post=9362"}],"version-history":[{"count":8,"href":"https:\/\/kabisa.nl\/en\/wp-json\/wp\/v2\/posts\/9362\/revisions"}],"predecessor-version":[{"id":9382,"href":"https:\/\/kabisa.nl\/en\/wp-json\/wp\/v2\/posts\/9362\/revisions\/9382"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kabisa.nl\/en\/wp-json\/wp\/v2\/media\/9359"}],"wp:attachment":[{"href":"https:\/\/kabisa.nl\/en\/wp-json\/wp\/v2\/media?parent=9362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kabisa.nl\/en\/wp-json\/wp\/v2\/categories?post=9362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kabisa.nl\/en\/wp-json\/wp\/v2\/tags?post=9362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}