Skip to content

Commit

Permalink
slight tweaks to the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickjames242 committed Mar 22, 2023
1 parent dea4f1c commit 3f5556d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ export const SubmitButton = ComponentExtenders.button<{
buttonTitle: string;
Icon?: ComponentType<{className?: string}>
}>((Button, { buttonTitle, Icon }) => {

return <Button className="submit-button">
{ buttonTitle ?? 'Submit' }
<Icon className="submit-button-icon">
Expand Down Expand Up @@ -514,7 +515,7 @@ export const MyButton = ComponentExtenders.button<{
// the resulting children value will be: "My Button"
```
If you would like to allow users to customize the children of the component, pluck the `children` prop.
If you would like to allow users to customize the children of the component, destructure the `children` prop and incorporate it into the component.
```tsx
import { ComponentExtenders } from './ComponentExtenders';
Expand Down Expand Up @@ -548,7 +549,7 @@ export const MyButton = ComponentExtenders.button(Button => {
title="My Favorite Button" // the outer prop takes precedence
/>

// the resulting button title will be "My Button"
// the resulting button title will be "My Favorite Button"

```
Expand Down

0 comments on commit 3f5556d

Please sign in to comment.