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
i have next js project and i embeed react-email-editor and when i navigate to the edit page and load the template . first time the template will be loaded but when i refresh the template 2 to 3 three times it give this error Could not find a valid element for given id or classname.
here is my code :
"use client"
import { useParams, useRouter } from 'next/navigation'
import React, { useEffect, useRef, useState } from 'react'
import Button from '../Button/Button'
import EmailEditor, { EmailEditorProps,EditorRef } from 'react-email-editor';
import { useMutation, useQuery } from '@tanstack/react-query';
import { getUserTemplateById, updateTemplate } from '@/services/templates/templates';
import axios from 'axios';
import { API_URL, config } from '@/services/api/api';
import Modal from '../Modal/Modal';
import Loader from '../Loader/Loader';
import Toaster from '../Toaster/Toaster';
i have next js project and i embeed react-email-editor and when i navigate to the edit page and load the template . first time the template will be loaded but when i refresh the template 2 to 3 three times it give this error Could not find a valid element for given id or classname.
here is my code :
"use client"
import { useParams, useRouter } from 'next/navigation'
import React, { useEffect, useRef, useState } from 'react'
import Button from '../Button/Button'
import EmailEditor, { EmailEditorProps,EditorRef } from 'react-email-editor';
import { useMutation, useQuery } from '@tanstack/react-query';
import { getUserTemplateById, updateTemplate } from '@/services/templates/templates';
import axios from 'axios';
import { API_URL, config } from '@/services/api/api';
import Modal from '../Modal/Modal';
import Loader from '../Loader/Loader';
import Toaster from '../Toaster/Toaster';
type Props = {}
const EditTemplate = (props: Props) => {
const params = useParams()
const router = useRouter()
const { templateid } = params
const TemplateId = Array.isArray(templateid) ? templateid[0] : templateid;
const emailEditorRef: any = useRef<EditorRef | null>(null);
const [openModal, setOpenModal] = useState(false)
const [templateData, setTemplateData] = useState({
name:"",
description:""
})
console.log("EditorRef", emailEditorRef)
return (
)
}
export default EditTemplate
The text was updated successfully, but these errors were encountered: