Hacker News new | past | comments | ask | show | jobs | submit login

What's particularly wrong with it? Looks like pretty standard React, with some custom hooks imported, and clearly defined props.

If you start at the bottom, with the actual component (https://github.com/ant-design/ant-design/blob/master/compone...), the logic is much clearer. Most of the other consts are just definitions that you pass to the component (see documentation at https://ant.design/components/table#table).

And for the long list of imports and such, any modern IDE can parse those for you and easily jump to the source or the type defs.

If you're complaining about how this looks vs traditional OOP code, etc., that's just a stylistic choice Meta made for React codebases a few years back. It actually does make components pretty easy to maintain over the long term because all the core logic is just in one long, flat file. Lots of vertical scrolling, but predictable outcomes and easily refactored chunks. But third parties typically just have to mimic that style. That's not on Ant, that's just how JS code is currently in fashion...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: