-
-
Notifications
You must be signed in to change notification settings - Fork 426
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
MUI React - please consider going fully stateless #282
Comments
Happy to hear you like MUI! In terms of using links to control tab state, you should be able to add an |
yes and no, tabs have and, of course, I could do everything using css classes, but then I would just be reimplementing the consider this example instead <Tabs>
<Tab active onClick={this.changeTab}>Tab 1</Tab>
<Tab onClick={this.changeTab}>Tab 2</Tab>
</Tabs>
<div>Pane 1 or 2 (decided by client code)</div> you see how all complexity goes away immediately? and it's just one component, that was just an example |
Sorry, I thought you were referring to the CSS/JS library. With regards to React, you can use There are currently two events emitted by the Tabs component, <Tabs defaultSelectedIndex="2" onChange={this.onChange}>
<Tab onActive={this.onActive} label="Tab 1">Content 1</Tab>
<Tab onActive={this.onActive} label="Tab 2">Content 2</Tab>
</Tabs> Do you know of another library with a Tabs component with a more fleshed out event model? |
in fact I don't, they are all overcomplicated and over-engineered unnecessarily (some more than others), it is like people completely miss the whole beauty of the simplicity of react, which is its best quality |
with regards to the |
@thealjey, have you considered making a pull request - since you may know more about React best practices than designers who happen to make React components? I imagine they would appreciate having a specialist aid them or even implement these types of changes and improvements for them, empowering the MUI team with freed up time to focus on the core of the CSS component catalogue. |
Yes, a pull request (or a spec document) would be very helpful! |
@Rob-pw there's no need to be sarcastic or defensive about it, I don't claim to be the best react specialist in the world @amorey if you want me to create a pull request that removes all of the functionality from the Tabs component, if you're generally open to the idea of "dumbing down" the components, I'll be more than happy to do that |
@thealjey, actually it was a compliment, I'm not specialised in React at all and have only a amateur working knowledge of it (as may be the case with CSS specialists with React not being their area of expertise). I've just stumbled upon this project but have a predisposed sensitivity to small teams being pulled from their strengths and core purpose. |
@thealjey A pull request would be useful but writing up a spec might be a better place to start. That way we can get feedback from others before making changes to the code. |
I, for example, would like to have a tab bar that navigates between separate pages using normal links.
Letting the user fully control and manage the state (or lack there of) just gives much more flexibility, not to mention might even simplify your own api.
This goes even further though, like dropdown closed/open state etc.
again, love this project
cheers 🥇
The text was updated successfully, but these errors were encountered: