I try to import a .txt file to show the text in a text box.
My code:
import React, { Component } from \'react\';
import \'./LoadMyFile.css\';
import
Not wanting to use fetch as it makes me have to deal with async responses. I solved my problem like this.
const mytext = `test
this is multiline text.
more text`;
export default mytext ;
import mytext from './mytextfile.js';
const gotTheText = mytext;
return ();