Getting thrown error about failed fetch.
Answered
American Chinchilla posted this in #help-forum
Original message was deleted.
8 Replies
American Chinchilla
and here is the file that im calling textConversion in to display it:
import React, { useEffect, useState } from "react";
import { textConversion } from "./api/test/textConversion/route";
function Reader() {
const [htmlContent, setHtmlContent] = useState('');
useEffect(() => {
textConversion().then((html) => {
setHtmlContent(html);
});
}, []);
return(
<div>
<div dangerouslySetInnerHTML={{ __html: htmlContent }} />
</div>
)
}
export default Reader;
I feel like the issue is when i'm calling the other file, so i'm going to provide myu file structure just incase it might be that
dont fetch your own api's
American Chinchilla
thanks i'll check that out
American Chinchilla
I've been looking at this, but would it work because i'm using pandoc and fs which would need server-side functionality