-
-
Notifications
You must be signed in to change notification settings - Fork 893
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
Rename the children
prop
#887
Comments
I am against this. There is no need to cause a breaking change for tiny gains. Especially if it’s a trade off that also comes with losses. If we rename it to A couple years ago, the property was renamed from |
@remcohaszing Shall I then close this? |
It’s a prop rename. We’ve had more of those. I also don’t think we should cut a major release just for this, but when it’s time for a major release, I would welcome this change. I also believe people will still pass invalid things if the prop is named differently. Indented multiline strings come to mind. But the I wouldn’t prioritize similarity to other libraries. I don’t really see the benefit of using the This is just a suggestion though. The current situation works on a technical level. Feel free to close this issue. But I think it would be better to avoid the |
Sure we’ve had breaking changes, but we don’t need to have breaking changes. |
Initial checklist
Problem
We require
children
to be a string. In theory this is completely fine, but sometimes this is confusing for users or doesn’t play nice with external tooling. Users often don’t know what they pass as children. Many users already struggle with multiline strings, but JSX children add another layer of confusion. #886 is a recent example. Typically children are passed to React directly, but in our case it’s processed using a unified processor.Some examples I could come up with:
Current solutions
Tell users the problem is outside of
react-markdown
. (Which it is! But we can improvereact-markdown
anyway.)Proposed solutions
Rename the
children
prop. For example, name itcontent
,value
, ormarkdown
.The text was updated successfully, but these errors were encountered: