feat: Add withConfigProvider to facilitate removal of wrapping every single component #286
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.
Instructions
main
Summary
Nearly all components currently in the aquarium (not all, just most) follow the same pattern of wrapping antd without modification, and exporting to consumers. The one functionality that is provided, however, is wrapping every individual antd component in Antd's
ConfigProvider
with mParticle's theme.We would not have to wrap antd components and re-export them wrapped in an mParticle
ConfigProvider
if the consumer had aConfigProvider
at it's root where the consumed component was being rendered.This initial PR will have several follow up PRs in consuming applications and also in aquarium. Namely to:
withConfigProvider
in various consuming UIs to provide a root mParticle ConfigProvider whereever an aquairum component is usedTechnically,
withConfigProvider
isn't even needed at all, consuming applications can just use<ConfigProvider>
at the root of their react tree. It's (arguably) a nice helper utility though to facilitate the removal of the responsibility of every single component to be wrapped and helps start the conversationTesting Plan
Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)