Fix EkriKomante ref

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-02-19 21:34:20 +04:00
parent 78cc9627d4
commit a756241d5e
+4 -5
View File
@@ -1,4 +1,4 @@
import {useCallback, useEffect, useState} from 'react' import {useCallback, useEffect, useState, forwardRef} from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import axios from 'axios' import axios from 'axios'
import { import {
@@ -13,10 +13,9 @@ import MuiAlert from '@mui/material/Alert'
const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:1337' const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:1337'
function Alert(props) { const Alert = forwardRef(function Alert(props, ref) {
return <MuiAlert elevation={6} variant='filled' {...props} /> return <MuiAlert ref={ref} elevation={6} variant='filled' {...props} />
} })
function EkriKomante({session, teks, meteEsKomanteOuve}) { function EkriKomante({session, teks, meteEsKomanteOuve}) {
const {jwt, user} = session const {jwt, user} = session
const {_id} = teks const {_id} = teks