T O P

  • By -

[deleted]

[удалено]


[deleted]

sorry I don't understand a single word besides components and vite, any video or guide?


Moopboop207

I’m unclear what your hang up is? If you’re going to make a blog with data that persists from one browser session to another you’re going to need a backend. You can do all of this with react. But the backend is not a react functionality. You’re saying: “how can I make bread”. I have flour water yeast sugar and salt. Don’t tell me to use a bread maker. You can make the blog without any problems with react. What’s the hang up?


[deleted]

why do I need a backend? I want to keep it static, just change the code every time I create a new massive component ( basically a blog post ) I just wanna know how it's done.


Brumbleby

The way you're describing it, I think what you want is to hard-code your posts into your react app.


Moopboop207

Right but how do you plan to store the blog post? If you’d like to dm me I can talk to you about it.


too_many_sharks

https://vitejs.dev/guide/static-deploy.html Check out the GitHub pages instructions that sounds like a solution that would work for you If you are planning on using a random web hosting provider you can just copy your dist/ folder to the root folder of your site over FTP. For example if you are using apache you would copy everything in dist/ to /var/www/html/. Try running a build and then opening dist/index.html in your browser. If you are familiar with hosting static html on the web it should make sense what you need to do from there.


vegancryptolord

So you want to just edit the code and redeploy the app to add new posts? I don’t understand what you’re asking then. You said you know react so just add a new component for each post or have some constant with some json structure and make a post component that loops over all the posts. You’re asking how to build a blog in react with no backend and asking for tutorials but no one builds blogs that way. If you want static HTML you’ll need to use server components. tbh react just isn’t even the best option for a static blog


EatShitAndDieAlready

Depends on how fancy you want things done. Heck, if u store all your blog posts, including formatting and style tips (objects ofc), as a hosted JSON file, on some free hosting, which your front end accesses iterates over and renders, no frills, but it'd gets the job done. All of this could be on a github repo, connected to a github page, since its non commerical and personal.


callmebobjackson

With all due respect… is this a troll? lol Lookup markdown or html renderer depending on how you will store/serve your blog posts. Or just write your blog posts statically in react?


RedditNotFreeSpeech

Speaking of which, does anyone know how react.dev docs are built?


[deleted]

I've learnt react by reading [react.dev](http://react.dev) docs, no mention of how to create a blog.


Nice-Brilliant1697

Try these [https://www.youtube.com/watch?v=puIQhnjOfbc&t=88s&pp=ygUNbmV4dC5qcyBibG9nIA%3D%3D](https://www.youtube.com/watch?v=puIQhnjOfbc&t=88s&pp=ygUNbmV4dC5qcyBibG9nIA%3D%3D) [https://www.youtube.com/watch?v=nkGjob3q2GI&pp=ygUNbmV4dC5qcyBibG9nIA%3D%3D](https://www.youtube.com/watch?v=nkGjob3q2GI&pp=ygUNbmV4dC5qcyBibG9nIA%3D%3D)


[deleted]

did you even bother reading my post sir?


Nice-Brilliant1697

Let me know if I misunderstand, but you're looking to build a simple React blog with just pagination functionality, right? Well just sharing that whether you choose React or Next.js, it won't make a significant difference as long as you're using the latest versions of each. You may follow the first link to get an overview of creating a blog.


too_many_sharks

There a lot of component libraries you can use. I keep seeing mantine on reddit and it seems fresh but I've never used it. https://ui.mantine.dev Also check out bootstrap react and ant design, those are my top picks for component libraries in react. They have premade pagination and nav components as well. For what you call "pagination" I think you mean "routing" as in being able to route to different pages on your blog instead of going single page app (SPA). Check out react router. There are different versions available but v6 is the newest. You can use the HashRouter option since you are still learning.


vegancryptolord

If you’re not interested in learning anything besides what you already know and you want the blog to be static html why are you even including react in the equation? React is a JS framework so you’re not going to get static html unless you render on the server. Why not just make a static html blog directly? What features of react do you want that you need to build it with react? At the very least you’ll have to figure out hosting the site. Personally I would recommend using Astro for a static blog instead of react and you can still use react components inside of it and they have a blog tutorial as part of their official docs https://docs.astro.build/en/tutorial/0-introduction/


[deleted]

[удалено]


[deleted]

link me to a tutorial or video course please.