just-boris
> This is impossible to express with a HOC without reimplementing the whole React in it.
What is the problem here? We return `null` from the beginning, then spinner, if reached timeout and finally, the provided component, if data has arrived.
Write your React code in Kotlin, compile to JS and use it everywhere where React is supported.
I am pretty much confident that everything worked well before you have made any modifications in the webpack config. So, the negative effects, that you are describing after, is a result of your efforts, but not anybody else.
And why did you want to eject in the first time? Most popular use-cases are already covered into create-react-app by default.
Currently, I (as well as most users, I suppose) just need to apply some global color overrides to match with company's brand guidelines that I can solve it with old good plain CSS.
Also, for big projects, like Antd, transition to some other CSS-tooling almost impossible, because CSS/LESS code is spread across several repositories and will take a lot of efforts and time.
And finally, the current implementation is better because it doesn't mention styles in Javascript at all, so the library users are able to choose any way to style components without extra efforts from the side of library authors.
I've been using Antd components for the last year in some my project. All components are also available here[0] as single modules for better reusability and customization.
Currently, I have solved all my theming goals with Plain CSS. For each component, that I'd like to customize I created a wrapper
import Slider from 'rc-slider';
function StyledSlider(props) {
return <Slider className="my-slider" {...props} />
}
Then in CSS .my-slider .rc-slider-track {
background: #FFDF66;
}
(This is a very simplified example, just shows the way).I have read about styled-components, but I don't understand how it would help me with theming. I don't think that rewriting every component from LESS to styled-components to make possible to use ThemeProvider will be an option because it doesn't give you any benefits comparing with customization guide[1], that also gives you good enough way to override defaults.
[0]: https://github.com/react-component/
[1]: https://ant.design/docs/react/customize-theme