Skip to content

request: enable triggering warnings on every render #3854

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

Closed
joeybaker opened this issue May 11, 2015 · 4 comments
Closed

request: enable triggering warnings on every render #3854

joeybaker opened this issue May 11, 2015 · 4 comments

Comments

@joeybaker
Copy link

On the client, it's nice that development warnings are only triggered on the initial render. But, when rendering from the server with renderToString it's annoying to only have the warnings triggered the first render and then ignored on subsequent page loads.

What if render methods accepted an additional options argument?

React.render(<span>hi</span>, window.app, {alwaysWarn: false})

React.renderToString(React.createElement(El, data), {alwaysWarn: true})

Crazy ideas: This might be useful for other options too? Perhaps: appendToBody (auto-appends the second arg), or ignoreDOMCalls (automatically catches/ignores errors to for window and document APIs)?

@joeybaker
Copy link
Author

Update: the basic problem seems to be that the loggedTypeFailures object is private.

if (error instanceof Error && !(error.message in loggedTypeFailures)) {
If this could be exposed publicly, users could opt-in to resetting it.

@joeybaker
Copy link
Author

@zpao would you be open to a PR that allows the disabling of loggedTypeFailures?

@jimfb
Copy link
Contributor

jimfb commented Sep 28, 2015

I'm going to close this out in favor of #4302, since that has been where most of the discussion has been taking place and I like the solution we arrived at in that thread.

@jimfb jimfb closed this as completed Sep 28, 2015
@joeybaker
Copy link
Author

Thanks @jimfb!

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

No branches or pull requests

4 participants