Skip to content

Commit

Permalink
Update readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
supnate committed Mar 3, 2023
1 parent ce12eca commit f0fd216
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,23 @@ In the example, the `onOk` property will override the result from `antdModal` he
## API Reference
https://ebay.github.io/nice-modal-react/api/

## FAQ
### Can I get context in the component tree in a modal?
Yes. To get the data from context in the component tree you need to use the declarative way. For example:
```jsx
export default function AntdSample() {
return (
<>
<Button type="primary" onClick={() => NiceModal.show('my-antd-modal', { name: 'Nate' })}>
Show Modal
</Button>
<MyAntdModal id="my-antd-modal" {...otherProps} />
</>
);
}
```
See more [here](https://github.com/eBay/nice-modal-react/issues/104).

## Testing

You can test your nice modals with tools like `@testing-library/react`.
Expand Down

0 comments on commit f0fd216

Please sign in to comment.