TopBarSelect types are broken
See original GitHub issueConsider following code example
import { BarChartIcon, TableIcon, TopbarSelect } from "@operational/components"
const displayItems = [{ label: "Table", icon: TableIcon }, { label: "Bar Chart", icon: BarChartIcon }]
const [activeDisplay, setActiveDisplay] = React.useState<any>("Table")
;<TopbarSelect
label="Display:"
selected={activeDisplay}
items={displayItems}
onChange={setActiveDisplay}
/>
It doesn’t work without any
in React.useState
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (15 by maintainers)
Top Results From Across the Web
Troubleshooting Geo - GitLab Docs
Check if PostgreSQL replication is working. Check the health of the secondary site. On the primary site: On the top bar, select Main...
Read more >What does: Error Broken count >0 mean? - Ask Ubuntu
Open a Terminal and type sudo apt-get upgrade . Check if you see an error similar to: E: dpkg was interrupted, you must...
Read more >Create and follow up a payment plan in iController
There are two types of payment plans in iController: ... On the top bar select Clients; In the list select a debtor/client; On...
Read more >QBSE Receipt Upload Failure - iOS 15 - QuickBooks - Intuit
Whatever broke a month and a half ago around the time iOS15 came out, ... From the top bar, select Assistant. Type Talk...
Read more >Configuring EUC Scouts - ControlUp Support
In the Scoutbees top bar, select Create Scout to open the Add New Scout window. ... Select the type of Hive (Cloud or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi 👋🏻 Can I take this one too ?
@march213 consider following code (standard React)
React standard components have to deal with event, because they are building blocks. But in our case we can simplify API and onChange can be called with value directly instead of event. (Does it make sense so far?)
So we should be able to write something like this
But our type system says that onChange can be called with ReactNode as well. Does it even make sense to have ReactNode provided to onChange? 🤔 How we gonna use ReactNode in state? (I mean generally we can, but we should not unless there is a specific reason for it).
So my idea is that
onChange
type signature should be(label: string) => void