React Folder Structure Best Practices - For Large Projects

React Folder Structure Best Practices - For Large Projects

PedroTech

2 года назад

93,624 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@AyomiposiAborisade-yu5is
@AyomiposiAborisade-yu5is - 26.11.2023 01:39

How to get the images properly, without importing it individually

And how to get absolute path of any file

Ответить
@proxy5366
@proxy5366 - 24.10.2023 20:12

I recommend eslint-plugin-project-structure for validating folder structure and file naming/file extension

Ответить
@Aliena92
@Aliena92 - 19.10.2023 12:38

What do you use instead of Redux then?

Ответить
@alex_blue5802
@alex_blue5802 - 15.10.2023 14:37

Personally I find it confusing to have multiple index.tsx files open and being unable to tell at a glance which components they are associated with. I do see how it gives the code a nice clean feel, though.

Ответить
@azizbakirov5301
@azizbakirov5301 - 23.09.2023 16:09

thanks bro

Ответить
@ronifintech9434
@ronifintech9434 - 12.09.2023 18:00

love the structure! can you please share the github repo name?

Ответить
@moonandwine
@moonandwine - 11.08.2023 03:09

Pedro, onde está seu linkedin? está retornando erro na pagina pelo link na descrição

Ответить
@thecodingchallengeshow
@thecodingchallengeshow - 29.07.2023 00:14

do big companies like facebook use this pattern and what am i supposed to do with react routing?

Ответить
@nhutdev1324
@nhutdev1324 - 13.07.2023 11:18

My rule of thumb is the longer and more descriptive the file name, the better. For files that export React components, I use PascalCase. For everything else, I use dash-case.

Ответить
@makl-the-oracle
@makl-the-oracle - 22.06.2023 19:31

Not it

Ответить
@ChinhNguyen-ye7nv
@ChinhNguyen-ye7nv - 14.06.2023 12:13

great

Ответить
@codetheworld6721
@codetheworld6721 - 16.05.2023 13:08

Thankyou..

Ответить
@louaiboumedienne8276
@louaiboumedienne8276 - 07.05.2023 18:48

@PedroTech, u said ur not using redux that much anymore, so what are u using as a state management solution?

Ответить
@TricoliciSerghei
@TricoliciSerghei - 27.04.2023 19:43

Thanks for the video.. Didn't find the link to the repository on github though, also checked on github, haven't seen it, maybe it has a different name?

Ответить
@hizokadarkwolf
@hizokadarkwolf - 13.03.2023 05:51

Thanks for the tips. The naming of files is always controversial, but organization is the most critical aspect. Insufficient naming and bad folder organization can be painful for the next developer working on a project... I learned that I had to rename and split the code into different files and folders in Angular. I will try this way, as I am just getting started on React.

Ответить
@nabeelyahya5150
@nabeelyahya5150 - 02.03.2023 12:15

this was really the best Structure i have seen , could you please share it with us on gitub

Ответить
@md.mohiulislam6516
@md.mohiulislam6516 - 03.02.2023 11:47

pls provide this project github repo.

Ответить
@cbijay
@cbijay - 25.01.2023 06:26

Where would you like to put layout inside setup folder or common folder ?

Ответить
@malletdevoted
@malletdevoted - 18.12.2022 16:13

Such a nice video, thanks for sharing.

Ответить
@beninip
@beninip - 30.11.2022 05:23

Hi PedroTech, I want to thank you for sharing this content to us. I'm wondering what's inside the common folder. You skipped it and you never went back on it.

Ответить
@oziati533
@oziati533 - 26.11.2022 11:47

Hi from Sweden 🇸🇪 😊 Love your videos and how you think in react, thanks for sharing!

Ответить
@renatolins4670
@renatolins4670 - 21.11.2022 05:38

Nice tutorial Pedro, I really liked it. I was just wondering if checking git/diff results involving component files, wouldn't be a bit harder in some situations or another as they are all named as 'index'. Anyway, thanks for sharing your knowledge man

Ответить
@PedroNovo93
@PedroNovo93 - 15.11.2022 01:31

@PedroTech you missed the common folder, haven’t you?

Ответить
@rajarock454
@rajarock454 - 21.10.2022 23:52

great ! which font you are using it's look pretty kindly let me know also with theme name.

Ответить
@sujikumarts7470
@sujikumarts7470 - 17.10.2022 13:43

Can we get the git hub location for a sample project with this directory structure , redux & graphql?

Ответить
@krzysztofkrukowski3127
@krzysztofkrukowski3127 - 28.09.2022 20:10

That is definitely not a folder structure for large projects. Maybe for medium ones

Ответить
@labilawal
@labilawal - 21.09.2022 00:51

I appreciate you making this video, as folder structure, granted, has caused me to pull my hair as our app is scaling. However, I do want to point out that there are some hooks that can be used globally and shouldn't be grouped under a specific page, is it ideal to create a "hooks" folder in the "src" parent folder?

Ответить
@edetmmekut809
@edetmmekut809 - 22.08.2022 20:09

I can't joint your discord channel via the above link ,can u please resend me the lastest link

Ответить
@edetmmekut809
@edetmmekut809 - 22.08.2022 20:06

yeah i prefer the absolute path in importing.And i notice u did not mention about reusable components like buttons,breadcrump,loader etc .For i do have a customised folder for reusable components

Ответить
@indrajithpatel5966
@indrajithpatel5966 - 22.08.2022 12:44

i dont see an index.ts at your pages level. How do you combine these components inside your pages

Ответить
@haina3052
@haina3052 - 18.08.2022 17:56

So, for each page you have a <<components>> folder. Where do you put your layout component like <Footer.ts>? What about a button component that is gonna be used in different pages? You duplicate them everywhere?

Ответить
@marcus4619
@marcus4619 - 02.08.2022 16:36

wont the test failure stack trace say index.test.ts and be confusing?

Ответить
@marcus4619
@marcus4619 - 02.08.2022 16:34

could you recommend some great extensions, for instance the way your files/folders have great icons. I cam from webstorm and looking for similar functionality

Ответить
@user-pq2uj8vj6m
@user-pq2uj8vj6m - 22.07.2022 16:26

thank you for your video. I'm always enjoying your video
and I have a question what's "common" folders for? and also models.ts in component folder?

Ответить
@user-pq2uj8vj6m
@user-pq2uj8vj6m - 22.07.2022 16:18

shit... I love you. you always give me what I want

Ответить
@i-am-the-slime
@i-am-the-slime - 18.07.2022 09:43

Isn't having one folder called "images" and one "svg" pretty ugly? Why not "png", "jpg", "svg" or "raster-images" and "vector-images". Or do you also have svg files in the images folder?

Ответить
@devproject8649
@devproject8649 - 16.07.2022 01:38

I don't understand what you do when the path to the file is "../../". Do you use jsConfig to put the path? please answer me

Ответить
@mumk
@mumk - 12.07.2022 16:37

where is your index.tsx for each page

Ответить
@devkasunlakshitha
@devkasunlakshitha - 11.07.2022 07:59

What you using to mange state instead of Redux?

Ответить
@diegounanue
@diegounanue - 11.07.2022 07:40

You said that you don’t use redux that much today. What state manager do you use?

Ответить
@rijogeorge5547
@rijogeorge5547 - 09.07.2022 03:29

What if there is a component which shared by different pages in the app ?

Ответить
@MasharipovSaidbek
@MasharipovSaidbek - 05.07.2022 14:40

GL

Ответить
@frankthedsigner558
@frankthedsigner558 - 04.07.2022 14:43

Wow, great video! I always find myself lost when having to setup a new project the correct way and I've watched many of your older folder structure videos in the past. Though, as my project scales it always gets messy but this is an awesome approach of doing it right from the start. Thanks for your updated video, love your content! keep it up!

Ответить
@louislecouturier
@louislecouturier - 04.07.2022 13:27

Thanks a lot Pedro ! What do you put in the common folder ?

Ответить
@chizuru1999
@chizuru1999 - 03.07.2022 00:01

I would like a video on state management of react. What to use for enterprise grade applications? Thanks.

I am familiar with Angular and just can't get head over the mess of a framework react is.

Ответить
@dailymeow3283
@dailymeow3283 - 02.07.2022 16:17

Just use next js, it is structured

Ответить
@ponderatulify
@ponderatulify - 02.07.2022 08:58

How do you do if you have posts and comments on the same page?

Ответить