I'm surprised that many huge React libraries don't expose its core Context for user to consume. Context is the most important concept in React. Actually, a library just need users to provide the right types of Context to be flexible. I'm tired of the "lock in" API, in which, it doesn't allow me to just get my context data into its arguments API. In this sense, you can consider Context as the local version of Redux.
Base Web, Uber’s New Design System for Building Websites in React
21–30 of 156 posts
Re: Base Web, Uber’s New Design System for Building Websites in React
#22Earlier quoted context omitted.
Sigh. I really wish people would just accept the fact that JavaScript is a dynamically typed language and stop making things unnecessarily difficult.
[flagged]
Re: Base Web, Uber’s New Design System for Building Websites in React
#23Imagine creating this beast of a "framework" and not even using TypeScript or Flow. What are you thinking? Edit: It does use Flow.
I wish there was a plugin that just did this automatically so you could toggle it back on when done. To clarify, it's mostly when working with 3rd party/other libs, where you don't have the background of the team.
Re: Base Web, Uber’s New Design System for Building Websites in React
#24I've been searching for a basic React UI component system for awhile now. There are a lot of systems available, but each one has significant drawbacks to the point I end up just rolling my own. I think an ideal system would have a core set of "unstyled" components with the necessary functionality baked in. That way the overall aesthetic is up to you, but a lot of the painstaking UI work (e.g. showing, hiding, and hig…
There’s some work being done around renderless ui components but I’ve yet to see a complete framework.
Re: Base Web, Uber’s New Design System for Building Websites in React
#25I'm surprised that many huge React libraries don't expose its core Context for user to consume. Context is the most important concept in React. Actually, a library just need users to provide the right types of Context to be flexible. I'm tired of the "lock in" API, in which, it doesn't allow me to just get my context data into its arguments API. In this sense, you can consider Context as the local version of Redux.
As someone who stopped doing React development before Context became a "thing", is it possible to ELI5 in a couple sentences why it is such an important concept?
One use case, is, suppose you have two independent contexts at two branches, now, if you want to share those data to 3rd branch, you just create new context with value from the first two contexts.
Re: Base Web, Uber’s New Design System for Building Websites in React
#26Can you use this outside of React? I'm interested in the styles, but I'm not using React.
Re: Base Web, Uber’s New Design System for Building Websites in React
#27Imagine creating this beast of a "framework" and not even using TypeScript or Flow. What are you thinking? Edit: It does use Flow.
My only issue is TS usage with extremely large/complex components/containers. For example, files around 500 lines of code, I've temporarily removed TS, done a few other optimizations (ternaries for obvious If/Else statements, etc) to reduce to ~200-230 lines total. The file is instantly easier to reason about and modify. I wish there was a plugin that just did this automatically so you could toggle it back on when do…
togglePanel = (newTogglePanelComponentState: Boolean) => {
return this.setState({ panelToggleState: newTogglePanelComponentState });
}
togglePanel = bool => this.setState({ panelToggle: bool })Re: Base Web, Uber’s New Design System for Building Websites in React
#28I'm surprised that many huge React libraries don't expose its core Context for user to consume. Context is the most important concept in React. Actually, a library just need users to provide the right types of Context to be flexible. I'm tired of the "lock in" API, in which, it doesn't allow me to just get my context data into its arguments API. In this sense, you can consider Context as the local version of Redux.
Re: Base Web, Uber’s New Design System for Building Websites in React
#29I'm surprised that many huge React libraries don't expose its core Context for user to consume. Context is the most important concept in React. Actually, a library just need users to provide the right types of Context to be flexible. I'm tired of the "lock in" API, in which, it doesn't allow me to just get my context data into its arguments API. In this sense, you can consider Context as the local version of Redux.
Are you talking about the theme? Can you be more specific?
Then in all components props, you'll have your own context value at every level deep in the tree.
Re: Base Web, Uber’s New Design System for Building Websites in React
#30Can you use this outside of React? I'm interested in the styles, but I'm not using React.
This is why Web Component interest is growing, especially w/ enterprises and large teams. The killer app for WC's is building Design Systems that don't force specific frontend framework decisions.