3 ms·
> Why do you feel that React-Redux has a "horrific API"? `connect()` is a function that takes 4 optional arguments. The first one is a function, the second is
by kansface 7y ago
> Why do you feel that React-Redux has a "horrific API"?
`connect()` is a function that takes 4 optional arguments. The first one is a function, the second is an obj or a function that returns an object, the third is a function that takes 3 arguments that returns an object, the last is an options object that takes up to 7 params (four of which are functions)! Unfortunately, you aren't done yet, because connect returns a function! You pass your new function a component and it returns a different one. Now, you have something you can use! That is the most complicated interface I've ever seen in any library.
`connect` makes code much harder to understand for what seems to be a simple task - wire some data into a component when the data changes.
> Do you feel that looks any better?
Yeah!