Better HN
topnewbestaskshowjobs
Log inSign up

just-boris

6 karma · joined May 3, 2015 (11y ago) · 9 submissions

Submissions

comment 8y ago · link · parent

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.

comment 9y ago · link · parent

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.

comment 9y ago · link · parent

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

comment 10y ago · link · parent

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.

comment 10y ago · link · parent

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

6.

Page object pattern for React.js components(medium.com ↗)

3 points · by just-boris · 10y ago · discuss

7.

Catching errors on Gulp.js(medium.com ↗)

1 points · by just-boris · 11y ago · discuss