a
Size: a a a
a
TM
RH
IO
O
@react-pdf/renderer
. Но он не берет твой хтмл и делает из него пдф. Пдфку нужно наверстать с помощью компонентов которые предоставляет либа.O
S
// const Modal = ({children}) => {
// const el = document.createElement('div');
// useEffect(() => {
// root.appendChild(el);
// return () => root.removeChild(el);
// }, []);
// return createPortal(children, el);
// }
S
class Modal extends Component {
constructor(){
super();
this.el = document.createElement('div');
}
componentDidMount(){
root.appendChild(this.el);
}
componentWillUnmount(){
root.removeChild(this.el);
}
render(){
return createPortal(this.props.children, this.el);
}
}
S
S
S
SG
SG
el
в массив зависимостей useEffect
?SG
AR
// const Modal = ({children}) => {
// const el = document.createElement('div');
// useEffect(() => {
// root.appendChild(el);
// return () => root.removeChild(el);
// }, []);
// return createPortal(children, el);
// }
AR
S
const [value, setValue] = useState('');
....
const handleChange = evt => useState(evt.target.value);
S
SG