eslint has pointed some tips so I'm not covering them here
I can be wrong and I'm not very experienced too, I'll be happy to take feedback and have positive discussion. Feel free to correct me. Sorry if it feels too opinionated.
Cherry pick dependency functions to reduce bundle size
Instead of
import _ from "lodash";
_.map() // stuff
use
import _map from 'lodash/map';
_map() // stuff
I have prefix lodash dependencies with _ but that's just my habit.
eslint has pointed some tips so I'm not covering them here
I can be wrong and I'm not very experienced too, I'll be happy to take feedback and have positive discussion. Feel free to correct me. Sorry if it feels too opinionated.
Instead of
use
I have prefix lodash dependencies with
_
but that's just my habit.Instead of
might be better to do this
and even better
I personally like this and redux examples are also presented like this. However in complex cases the original way might turn out to be better.
The above can be written in much more react idiomatic way -
Instead of
do this
indexOf
and{alphabet : alphabet})