-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console error on settings page in teams #937
Comments
This is a react-tabs issue. It's on stackoverflow that someone submitted a fix to react-tabs: Basically, react-tabs expects the TabPanel to render but really we just have it rerouting through react-router |
Looks like the next step is to update react-tabs when the fix is merged. |
A fix to reactjs/react-tabs#329 would also help resolve this. |
React-tabs collaborator here. I'm genuinely so confused by this. What's the point of using <Tabs
selectedIndex={getTabIndex(pathname)}
onSelect={(i) => navigateToNav(i)}
>
<TabList>
{settingsSubNav.map((navItem) => {
// Bolding text when the tab is active causes a layout shift
// so we add a hidden pseudo element with the same text string
return (
<Tab key={navItem.name} data-text={navItem.name}>
{navItem.name}
</Tab>
);
})}
</TabList>
</Tabs> Which seems like a clear misuse of the component. Why not simplify that to something like <ul className="NavItems">
{settingsSubNav.map((navItem, index) => (
<li className={cx("NavItems-item", { "is-active": index === getTabIndex(pathname) })}>
<button onClick={navigateToNav}>{navItem.name}</button>
</li>
))}
</ul> and get rid of the dependency for this |
@joepvl Thank you for bringing this up. This is basically an oversight in our tech debt as we were getting to know the library in the early days of our code. We have other instances of React Tabs that are using it correctly, but we need to clean this up using your idea. |
Fleet version (Head to the "My account" page in the Fleet UI or run
fleetctl version
):teams
Operating system (e.g. macOS 11.2.3): Any
Web browser (e.g. Chrome 88.0.4324): Any
🧑💻 Expected behavior
Navigate to https://localhost:8080/settings/organization. No warnings appear in the console.
💥 Actual behavior
Following error in the console:
More info
@martavis assigning this to you as another likely easy fix that gets you working in the codebase. Please lmk if you have any questions!
The text was updated successfully, but these errors were encountered: