Add dangerouslySetDefaultInnerHTML#2258
Add dangerouslySetDefaultInnerHTML#2258syranide wants to merge 1 commit intofacebook:masterfrom syranide:dsdih
Conversation
|
Not sure this convenience is needed. getDOMNode().innerHTML works and provides an indication that you're breaking out of the abstraction. If we add this, shouldn't we also provide a way to generate default content in a safer way? Such as using ReactElements? |
|
@sebmarkbage |
|
Also not sure I see the value in this. dangerouslySetInnerHTML is sort of an escape hatch already and you can always continue to pass the old value if you don't want to blow away manual (or contenteditable) changes. You can also set Going to close this out but reopen if you feel strongly. |
|
@spicyj I don't really feel much at all about this, but it strikes me as a bit odd when we promote "easy escape hatches" as an important feature (I would argue Yeah Anyway, don't feel strongly, it just seems a bit odd. |
dangerouslySetInnerHTMLis a poor fit when trying to provide initial children for other libraries to consume, while safe as long as you don't update the value, it's not very sanitary and in some ways relies implementation details.dangerouslySetDefaultInnerHTMLworks just likevaluevsdefaultValue, as you would expect.Should probably be named
dangerousDefaultInnerHTML, but I kept the current naming convention until #2257 is resolved.