File tree Expand file tree Collapse file tree 1 file changed +16
-17
lines changed Expand file tree Collapse file tree 1 file changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -409,23 +409,6 @@ In the example, the `onOk` property will override the result from `antdModal` he
409
409
## API Reference
410
410
https://ebay.github.io/nice-modal-react/api/
411
411
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
-
429
412
## Testing
430
413
431
414
You can test your nice modals with tools like ` @testing-library/react ` .
@@ -474,6 +457,22 @@ yarn start
474
457
475
458
Then you can access http://localhost:3000 to see the examples.
476
459
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).
477
476
478
477
# License
479
478
MIT
You can’t perform that action at this time.
0 commit comments