Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an option to suppress the dev-mode warning message #5556

Closed
jonnyreeves opened this issue Jan 27, 2024 · 6 comments
Closed

Provide an option to suppress the dev-mode warning message #5556

jonnyreeves opened this issue Jan 27, 2024 · 6 comments

Comments

@jonnyreeves
Copy link
Contributor

The dev-mode warning written to console.warn() triggers a toast in react native development builds which needs to be dismissed each time the app is started.

I understand this is a helpful message for some, but once acknowledged it would be a better developer experience if it could be supressed.

I propose this could be achieved through a process.ENV check, something like:

init: () => {
        if (!process.env.SUPRESS_DEV_MODE_WARNING) { 
                console.warn(

Happy to raise a PR if others are aligned?

@pubkey
Copy link
Owner

pubkey commented Jan 27, 2024

Is this really the case? Does react-native require user interaction on console.warn? I could not find anything about that online.

EDIT: You are right, it will show a visible yellow box: https://kadikraman.github.io/react-native-v2/debugging

You can make a PR for that, but notice that process is not always available so a normal disableWarnings() function should do.

jonnyreeves added a commit to jonnyreeves/rxdb that referenced this issue Jan 28, 2024
@adam-lynch
Copy link
Contributor

👍 I'd use this option even in our web app

@pubkey
Copy link
Owner

pubkey commented Jan 30, 2024

Fixed and released in the latest release. Thanks @jonnyreeves

@pubkey pubkey closed this as completed Jan 30, 2024
@jonnyreeves
Copy link
Contributor Author

jonnyreeves commented Jan 30, 2024 via email

@adam-lynch
Copy link
Contributor

Needs a docs update

@pubkey
Copy link
Owner

pubkey commented Jan 30, 2024

@adam-lynch Yes, added here 2bf8467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants