News for hackers. Stuff that matters.

just-boris

Thank you! I appreciate all your replies, but want clarify this one:

> 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.

Re:Kotlin 1.2 Released: Sharing Code Between Platforms on Wednesday November 29, 2017 @04:36AM (#15805678)
Why do you compare Kotlin against React? They can work together: https://blog.jetbrains.com/kotlin/2017/04/use-kotlin-with-np...

Write your React code in Kotlin, compile to JS and use it everywhere where React is supported.

Re:Webpack 3: Official Release on Tuesday June 20, 2017 @04:05PM (#14598087)
> I tried bootstrapping it with `create-react-app` and ejecting, so I can modify webpack config

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.

Re:Show HN: Antd – A set of high-quality React components on Monday November 28, 2016 @05:36AM (#13054597)
The ability to apply different overrides for some branches in a component tree is powerful. Sure, I will come back to styled-components when I will get that issue.

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.

Re:Show HN: Antd – A set of high-quality React components on Monday November 28, 2016 @04:49AM (#13054417)
Hello!

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