Skip to content

Creating a theme with React #1302

Discussion options

You must be logged in to vote

@joelcosta-mooddie give this PR a try: #1304

After you have it locally you'll want to do the following:

  • Run artisan create:theme mytheme tailwind to generate a theme that makes use of Tailwind
  • Run artisan vite:create theme-mytheme --tailwind --react --force to generate the required files for React
  • Run artisan vite:install and answer yes to the prompt asking to include mytheme in your package workspace if it asks.
  • Add {{ viteReactRefresh('theme-mytheme') }} immediately above the {{ vite() }} tag in themes/mytheme/partials/site/footer.htm
  • Add <div id="root"></div> wherever you want your React app to be injected into the DOM (either in themes/mytheme/layouts/default.htm or themes/mytheme/pa…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@joelcosta-mooddie
Comment options

Answer selected by LukeTowers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants