Replies: 1 comment 1 reply
-
There is not really a a question "which we prefer". Personally I think default exports should be removed from the spec, but for the same reason that is not going to happen we will also not change this best practice. Of course you can do in your own code base as you prefer it. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I noticed that the example code in the doc is exporting reducer from a file whose name ends with slice. Then the import statements for it would be like
import reducer from './slice'
. This does not look very intuitive to me. So I'd like to confirm if this was intended and see your opinions about this.Examples from doc
https://redux-toolkit.js.org/usage/usage-guide#using-createentityadapter-with-normalization-libraries
And its usage might be
import usersReducer from 'features/users/usersSlice'
🤨Note: there could be more exported members in the file, like actions and selectors. I do not list them in the options below but they shall exist in the file as well.
Thank you!
3 votes ·
Beta Was this translation helpful? Give feedback.
All reactions