You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was getting this error when using the modal. In case anyone else gets stuck in how this can be resolved I created this issue so maybe the maintainers can improve the docs a little or even add a quick note on this in the type description for
/**
* A function that returns a backdrop component. Useful for custom
* backdrop rendering.
*
* ```js
* renderBackdrop={props => <MyBackdrop {...props} />}
* ```
*/
renderBackdrop?: (props: RenderModalBackdropProps) => React.ReactNode;
maybe add
**Note:** the component should make sure to apply the provided ref.
import{forwardRef}from'react';
...
constBackdrop=(props: any)=>{console.log('>>>backdrop props',props);return(<divref={props.ref}{...props}className={modalStyles.Backdrop}></div>);};// key to workconstBackdropFRef=forwardRef((props)=>{return<Backdrop{...props}/>;});functionModalExample(
...
// from docsconstrenderBackdrop=(props: any)=><Backdrop{...props}/>;// afterconstrenderBackdrop2=(props: any)=><BackdropFRef{...props}/>;<ModalclassName={modalStyles.Modalv3}show={show}onHide={()=>setShow(false)}onBackdropClick={()=>setShow(false)}backdrop={true}// renderBackdrop={renderBackdrop}renderBackdrop={renderBackdrop2}aria-labelledby="modal-label"><divclassName={modalStyles.ModalBody}><h4id="modal-label">Text in a modal</h4><p>
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
</p><PortalModalExtra/></div></Modal>
...
Additional context
Will try to push a PR if I get time and it makes sense. Figured the maintainers may have a better idea in mind for the same result.
The text was updated successfully, but these errors were encountered:
Describe the bug
Was getting this error when using the modal. In case anyone else gets stuck in how this can be resolved I created this issue so maybe the maintainers can improve the docs a little or even add a quick note on this in the type description for
maybe add
To Reproduce
Steps to reproduce the behavior:
Reproducible Example
See steps above
Expected behavior
No console error
Screenshots
Environment (please complete the following information)
13.2.1
Version 112.0.5615.49 (Official Build) (arm64)
"@restart/ui": "^1.6.2",
How I got it working
Additional context
Will try to push a PR if I get time and it makes sense. Figured the maintainers may have a better idea in mind for the same result.
The text was updated successfully, but these errors were encountered: