Urgent: Adjust component prop-types for use in MjmlAttributes #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the prop-types assume most components have children. This is
not the case in when used within the MjmlAttributes component.
This PR removes the
isRequired
from all mjml components so they can beused inside the Atttributes.
This is an example email that is valid in MJML but not in mjml-react currently: https://mjml.io/try-it-live/k1kGrokirG2 (full email is at the bottom in case the link gets modified)
Disclaimer: I haven't used prop-types in ~4 years so I'm definitely not in the know of how to use them please correct me if I'm doing something wrong.
Why it's Urgent
This is urgent because I'm a maintainer on the DefinitelyTyped Types and the DefinitelyTyped maintainers wants us to conform to the types in this libraries prop-types. If we do it the way the prop-types are done currently we will throw a bunch of compile time errors for things that are allowed in MJML. ref: DefinitelyTyped/DefinitelyTyped#56254 (comment)
Example Email