r/learnreactjs • • Jul 04 '24

Need help/suggestion for self learning

As title says I'm a self taught learner, learning the react in an on off situation as I have a full time job (I'm not from IT background). I have seen many tutorials and stayed in that tutorial hell for a long time. But now I have decided to break out from the loop and learn by my own, but here comes the big problem that is from where should i get project ideas to do things my own and the resources to help me to build it.

PS. Just ignore my language mistake.

2 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/Buzzing_soul Jul 08 '24

Thanks for the suggestions and resources I really appreciate it. I didn't mention it but i have learnt the basics of javascript and worked with it in my learning journey, but now I'm moving to react. In react I have learnt about the component state and props, but I get stuck whenever I try to build two different components with different functions to appear on a single page. And the CSS is a big hurdle for me as I have not learned much about it. So should I learn CSS or CSS Library for react.

2

u/detached_obsession Jul 08 '24

You should learn CSS because styling libraries rely on your knowledge of it. Use styling libraries in your projects, but make sure you really learn CSS.

When you get stuck I highly suggest looking at the react docs. They not only serve as the source of truth for how react is intended to be used, but also have some best practices suggestions and tutorials for getting started: https://react.dev/learn.

You can post your specific question here or another more active subreddit and I'm sure someone will help out.

To show different components with different functions though you just need to make sure that there's a component that uses them both. For example, to show a Header and Content component, a parent App component needs to return them as if they where html tags. Any props they need can come from App, or other ways you'll learn about such as context.

const Header = () => <h1>Welcome to My App</h1>;

const Content = () => <p>This is the main content.</p>;

const App = () => (
  <div>
    <Header />
    <Content />
  </div>
);

Btw, if you're wondering why there's no return in that function, it's because it's an implicit return, a feature of arrow functions. Just a shorthand way of writing simple functions that return something right away.