Comments (7)
We don't run those checks in production mode because they will produce errors the user won't see nor will mean anything to them.
I'm not sure I agree that wrapping these settings in another level of objects makes things more clear. It seems like needless indirection. It doesn't really affect anything, as you will always see these things during dev or test modes and will have the tools to address any issues there. Whereas in production those tools are not usually available.
from react-redux.
@timdorr “ We don't run those checks in production mode”
The problem is that the current names usage gives impression for the opposite- that they used in any mode.
When someone sees
Provider store={store} stabilityCheck="always"
they will ask - how to specify, that the flag is applied only in dev mode.
If you don’t want to create a new object, consider to give properties more descriptive names, e.g. devModeStabilityCheck and devModeIdentityFunctionCheck
from react-redux.
You will only ever notice that these options exist when you get the according error messages, which will hopefully trigger that you read up on those error messages. 99% of the time after that you won't need those options, but will instead fix your code.
Only in very rare cases you will ever need to set those options. In those cases you will have recognized a need for those options, and looked them up in the documentation - which tells you that they are dev-only checks.
In this case, it seems you only looked at the examples without reading the text above them - the first words are literally "in developement".
What might be a good idea would be that we add docblocks to these options, explaining a little more about them - but generally, these should never be discovered any other way than "I saw the error message and then I read the docs".
Changing their name won't help, since the name still wouldn't explain what they exactly do - in the end we would end up with devModeCheckThatWillCheckIfYourSelectorReturnsAStableResultForMoreInformationPleaseReadTheDocumentation="once"
.
We can only document so much :/
from react-redux.
It's also worth noting that any change to naming or format at this point would be a breaking change, meaning it couldn't be done until the next major release.
from react-redux.
If you hover over them, the description actually states that they run in development mode.
from react-redux.
@phryneas “You will only ever notice that these options exist”
People notice when they see the code Provider store={store} stabilityCheck="always"
(that likely was set by some other developer”
Self-explaining name is preferred to ambiguous name, that require documentation to understand the functionality.
@EskiMojo14 , yes, it is proposed to consider for the next major release.
@aryaemami59 not every tool/ide supports hover over.
from react-redux.
@michael-freidgeim-webjet it's as self-explanatory as <div>
, Provider
, children
, or store
:
Everything needs to be looked up or learned once.
The alternative would really be a name that's probably as long as the full documentation - what seems intuitive for you will seem unintuitive for someone else, so we'd end up patching more and more words onto it with every complaint up to the point where it becomes unwieldable.
The current name is fine and we are not going to change it for people who refuse to use a modern IDE or read the documentation.
If you suspect that someone in your team might see it and not know what it means, you are free to add a comment to your code.
<Provider store={store} /*devModeOnly*/stabilityCheck="always">{children}</Provider>
from react-redux.
Related Issues (20)
- Connect not working with detox envinronment HOT 2
- Getting issue in middleware of configureStore when update redux-toolkit to 2.0.1 HOT 1
- useDispatch() causing unexpected navigate back to previous screen HOT 3
- Single global store and two Provider occurs an error for microfrontend app HOT 1
- Test fail with provider in react-native HOT 3
- useSelector hook seems to break hook parsing in React Developer Tools HOT 2
- TypeScript: not possible to use a component's `store` and `context` props when wrapped with `connect` HOC HOT 2
- docs: v9.0.0 release missing information HOT 1
- Connected children components might have mapStateToProps not called HOT 18
- Website search is broken HOT 2
- Hooks API Reference uses misnamed type in the useSelector() example HOT 1
- Include UMD build artifacts for latest release HOT 2
- Unstable selectors causes infinite loop in React
- Can't NPM Install Redux with Vite React + Typescript HOT 2
- Compatibility with React 19 types HOT 3
- Getting erro while installing react-redux example project of Nextjs HOT 1
- Unable to install @reduxjs/toolkit on Next.js project HOT 7
- Is there any plan to resolve the CVE-2023-45133 vulnerability that depends on the software Babel? HOT 1
- useSelector doesn't infer selector types properly with shallowEqual
- Your Docusaurus site did not load properly. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-redux.