JSFiddle - React, Tailwind, and code Playground

by deathstalkersid

JavaScript

const path = window.location.pathname.split('/')[0];
if(path.length) {
	document.getElementById(`menu-#{path}`).classList.add('active');
} else {
  document.getElementById(`menu-welcome`).classList.add('active');
}