-
-
Notifications
You must be signed in to change notification settings - Fork 918
Closed
Labels
💪 phase/solvedPost is donePost is done💬 type/discussionThis is a request for commentsThis is a request for comments🗄 area/interfaceThis affects the public interfaceThis affects the public interface🧑 semver/majorThis is a changeThis is a change
Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Problem
Typically a className prop in React adds a class name to the element it creates. For react-markdown this is not the case. Instead, it creates a wrapper that gets the class name. This is a fairly useless feature, because the user can wrap the content in a wrapper component themselves. That even gives the user more control.
In other words, these two are equivalent:
import Markdown from 'react-markdown'
export function Component({ children }) {
return (
<Markdown className="some-class">
{children}
</Markdown>
)
}import Markdown from 'react-markdown'
export function Component({ children }) {
return (
<div className="some-class">
<Markdown>
{children}
</Markdown>
</div>
)
}Solution
Deprecate the className prop, and remove it in then next semver major release.
Alternatives
- Do nothing.
- Don’t deprecate it.
- Make a semver major release just for this.
vorant94 and stevenruidigaoYutaMoriJP
Metadata
Metadata
Assignees
Labels
💪 phase/solvedPost is donePost is done💬 type/discussionThis is a request for commentsThis is a request for comments🗄 area/interfaceThis affects the public interfaceThis affects the public interface🧑 semver/majorThis is a changeThis is a change