Closed jmathtech closed 2 years ago
Sidebar navigation fixed. Added the Hook useState to toggle the menu to open and close.
Navbar.jsx
function Navbar() {
const [isOpen, setOpen] = useState(false);
I moved the scripts into the body instead of the head tag. DOH! index.html
<script src="https://code.jquery.com/jquery-3.6.1.min.js">
</script>
<script>
document.addEventListener('DOMContentLoaded', function () {
var elems = document.querySelectorAll('.sidenav');
var instances = M.Sidenav.init(elems, options);
});
$(document).ready(function () {
$('.sidenav').sidenav();
});
</script>
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
Tried using the Materializecss.com javascript files and the script in the index.html. Still doesn't work.
index.html
Navbar.jsx - using the Materializecss (materializecss.com) dependency for the navigation menu.