Open andrwo opened 2 years ago
UPDATE: I see it's applied. Thank you.
@andrwo Could you insert this to the description? GitHub will automatically close the issue if this gets merged.
Closes #391
Late to the ball on this one -- I'll read through this in a couple hours to get a proper review in. 🚀
Adds a new renderProp to allow user to customize how to render the component.
Description
Adds a new prop to IntlTelInput:
Currently, the rendering of the component is fixed with a
<div>
around<FlagDropDown ...>
and<input>
. If this callback is provided, instead of rendering the fixed default, will call the callback with the relevant props for user to customize their own rendering.If callback not provided, will use the existing default rendering (
<div ...> <FlagDropDown ...> <input ... >
), so it does not affect any existing usages.This allows users to customize using whatever Input component from any UI libraries (bootstrap, Material UI, etc.),. This enables this component to work smoothly with material UI (and other UI libraries) without messing around with the CSS to reproduce the UI's behaviour.
Will post CodeSandbox when I figure out how to link the module dependency to my fork...
Example usage (Material UI):
Example usage (reactstrap (bootstrap React)):
Screenshots:
Below are actual working implementation of above code:
Material UI:
Reactstrap (Bootstrap React):
Types of changes
Checklist:
Closes #391