Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

JS problem on HTML theme which I am using it in React project


Hi, I have a React project and use your HTML themes. When I add JS files, they run but there are two console error. Because of these errors, theme modules are not working correctly. How can I fix it? I don't want to directly your React projects. Thank you.


index.html

<img src=" />


index.js

<img src=" />


App.js


import Footer from "./partials/Footer";
import Header from "./partials/Header";
import Sidebar from "./partials/Sidebar";
import Scrolltop from "./partials/Scrolltop";

import {
Routes,
Route,
} from "react-router-dom";

import {Helmet} from "react-helmet";

import Dashboard from "./pages/Dashboard";
import Projects from "./pages/projects/Projects";
import Project from "./pages/projects/Project";

function App() {
return (
<div className="d-flex flex-column flex-root app-root" id="kt_app_root">
<div className="app-page flex-column flex-column-fluid" id="kt_app_page">

<Header />

<div className="app-wrapper flex-column flex-row-fluid" id="kt_app_wrapper">

<Sidebar />

<div className="app-main flex-column flex-row-fluid" id="kt_app_main">
<div className="d-flex flex-column flex-column-fluid">
<div id="kt_app_content" className="app-content flex-column-fluid">
<div id="kt_app_content_container" className="app-container container-xxl">

<Routes>
<Route path="/" element={<Dashboard />} />
<Route path="/projects" element={<Projects />}>
<Route path=":projectId" element={<Project />} />
</Route>
</Routes>

</div>
</div>
</div>

<Footer />
</div>
</div>
</div>

<Scrolltop />

<Helmet>
<script src="/assets/js/theme-mode.js"></script>
<script src="/assets/plugins/global/plugins.bundle.js"></script>
<script src="/assets/js/scripts.bundle.js"></script>
</Helmet>

</div>
);
}

export default App;


Note: SmoothScroll error break menus and data-kt-menu-trigger features. Other error break theme mode

<img src=" />
<img src=" />
<img src=" />
<img src=" />


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi,

About the error with SmoothScroll, try to use https://github.com/cferdinandi/smooth-scroll, you need somehow add a polyfill of SmoothScroll.

About the second error => difficult to help you with this, cause we can't support a mix of HTML+jQuery versions with a custom React application. HTML+jQuery version isn't SPA ready, not sure that it can be merged with React page(component) life circle.

Regards,
Keenthemes support


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(