Tell us what’s happening:
I am currently using React to work through the random quote machine challenge on CodePen, and I have the basic framework and style of my site set up.
I’d very, very strongly advise using CodeSandbox (or StackBlitz or similar) for React. CodePen is really designed for tiny little sketches, not apps: writing an entire app in a tiny little textbox that resolves to a single file is not likely to be a fun experience.
In comparison, CodeSandbox is a full code editor that lets you create muliple files and has all build tooling already set up. And if you need a JSON file, you should just be able to do import whateveritis from "./some-file.json"
Hey @DanCouper, I think you left out one important word: “against”
Completely agree, don’t use codepen for these front-end challenges. If you are going to use react then I would suggest you build these locally using Create React App. It will introduce you to modern dev tools and processes used to create real world web applications.
I agree, using Codepen for React just isn’t a great experience.
Here is an article on data fetching in React should you need it. You can fetch the raw JSON from the repo. Or as said, when using CodeSandbox you can just download the raw JSON file and use it as a file (add it as a file and import it in the component).
Shouldn’t take too much effort to transfer the code to CodeSandbox and it will be worth it. But if you want to keep the Codepen and need more help just ask.
@DanCouper@lasjorg@bbsmooth thanks for the replies guys, I’m real new to coding and have only learned from FCC so far, and have only used codepen as they directly link it from the challenge.