Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 18, 2021 02:25 pm GMT

7 of 100DaysOfCode

Seventh Day.
Today I learned some really nice features that React provides and I learned how to include Tailwind CSS in a Next.js application.

Anyway here are my today's learnings:

  • Render props method In the continuation of the HOC that I learned yesterday, today I learned more about the render prop method that can be used to optimize our code.
    • It's a pretty long concept so here is a gist:A component with a render prop takes a function that returns a React element and calls it instead of implementing its own rendering logic.
    • In layman's terms Think of render props as a component that surrounds our existing component and provides our existing component property and values it can use.
  • Context and useContext() hooks
    • This API was designed to share data across the multiple layers of child components without using props drilling.
    • This API contains a Provider to which we can pass a value that can be accessed by all its child components.
    • we also need a reference to this Context that we created that we need to pass in useContext() as an argument to access the values given to the provider.
  • Components styling
    • I haven't used it by myself at all till now but I learned how to include Tailwind CSS in a Next js project.
  • I learned about "dev dependencies" inside the package.json file.
  • @apply directive offered by Tailwind CSS to combine lots of different small classes to make a big usable class.

You can check out HOC (Higher Order Components) in my yesterday's post if you wanna know more.

If any would like to suggest me something since I'm new to React and Next.js or if there are some mistakes in the post, please let me know.
I'll really appreciate that.

Thanks for reading it.
Have a beautiful day.


Original Link: https://dev.to/icecoffee/7-of-100daysofcode-2lbi

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To