All uses of QuestProvider and useQuest should be removed and replaced with the shared package @shared/requests. The shared requests package contains more clients than useQuest did, can be used more easily in vanilla JavaScript/Typescript, and doesn't require a provider to be in the React component tree to access it.
Below is a diff showing how to replace useQuest with @shared/requests:
import React, { useState, useEffect, useRef } from 'react'
import PropTypes from 'prop-types'
-import { useQuest } from '@rhythm/react-quest'
+import { melodyApi } from '@shared/requests'
import { TinyMcePreview } from '../../../../../../../../../../../components/TinyMce/TinyMcePreview'
export const ContentPreview = (props) => {
const { content, editorHeight = '356px' } = props
- const { melodyApi } = useQuest()
const [preview, setPreview] = useState('')
const isMounted = useRef(true)
Once useQuest is no longer used, QuestProvider can be removed from the component tree.