Example React Project for Version 9
I noticed there is React support in version 9.0. According to the docs it involves creating a vite react app and copying and renaming folders from the download package. I followed the steps but it's not working. Can you provide an example zip file or repo of a working react example for 9.0
Replies (5)
Hi,
Please see the instructions below to get working example:
- Open the repo at https://github.com/KeenthemesHub/metronic-tailwind-html-integration.
- Download the
metronic-tailwind-reactfolder. - Copy the
srcfolder from themetronic-tailwind-htmlpackage and paste it into themetronic-tailwind-react/srcdirectory. - Rename the copied folder to
theme. The directory structure should now look like this:metronic-tailwind-react/src/theme. - Copy the media folder from
metronic-tailwind-html/dist/assetsand paste it intometronic-tailwind-react/public. - Install dependencies with
npm installand serve the project withnpm run dev.
Please let us know if you need any help on this topic or anything else.
Regards,
Lauris Stepanovs,
Keenthemes Support Team
Thanks for the prompt reply. I tried that and still getting some typescript and tailwind errors.
KTLayout.init(); // KTLayout is missing init()
tailwind.config.js //ESLint: 'require' is not defined.(no-undef)
demo1.js //ESLint: 'KTMenu' is not defined.(no-undef), KTToggle, etc
Same problem for me. I followed the above steps but gets this error:
PS C:\...\metronic-tailwind-html-integration-main\metronic-tailwind-react> npm run build
> metronic-react-tailwind@0.0.0 build
> tsc -b && vite build
src/App.tsx:12:14 - error TS2339: Property 'init' does not exist on type 'typeof import("C:/.../metronic-tailwind-html-integration-main/metronic-tailwind-react/src/theme/app/layouts/demo1")'.
12 KTLayout.init();
~~~~
Found 1 error.
HI,
To fix this error in file src/theme/app/layouts/demo1.js you should change
KTDom.ready(() => {
KTLayout.init();
}); to
export default KTLayout; Regards,
Lauris Stepanovs,
Keenthemes Support Team