Skip to content

Commit a074ec9

Browse files
authored
Update README.md
1 parent 3e8e96c commit a074ec9

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

README.md

+16-17
Original file line numberDiff line numberDiff line change
@@ -409,23 +409,6 @@ In the example, the `onOk` property will override the result from `antdModal` he
409409
## API Reference
410410
https://ebay.github.io/nice-modal-react/api/
411411

412-
## FAQ
413-
### Can I get context in the component tree in a modal?
414-
Yes. To get the data from context in the component tree you need to use the declarative way. For example:
415-
```jsx
416-
export default function AntdSample() {
417-
return (
418-
<>
419-
<Button type="primary" onClick={() => NiceModal.show('my-antd-modal', { name: 'Nate' })}>
420-
Show Modal
421-
</Button>
422-
<MyAntdModal id="my-antd-modal" {...otherProps} />
423-
</>
424-
);
425-
}
426-
```
427-
See more [here](https://github.com/eBay/nice-modal-react/issues/104).
428-
429412
## Testing
430413

431414
You can test your nice modals with tools like `@testing-library/react`.
@@ -474,6 +457,22 @@ yarn start
474457
475458
Then you can access http://localhost:3000 to see the examples.
476459
460+
## FAQ
461+
### Can I get context in the component tree in a modal?
462+
Yes. To get the data from context in the component tree you need to use the declarative way. For example:
463+
```jsx
464+
export default function AntdSample() {
465+
return (
466+
<>
467+
<Button type="primary" onClick={() => NiceModal.show('my-antd-modal', { name: 'Nate' })}>
468+
Show Modal
469+
</Button>
470+
<MyAntdModal id="my-antd-modal" {...otherProps} />
471+
</>
472+
);
473+
}
474+
```
475+
See more [here](https://github.com/eBay/nice-modal-react/issues/104).
477476
478477
# License
479478
MIT

0 commit comments

Comments
 (0)