DEV Community

Osinachi Chukwujama
Osinachi Chukwujama

Posted on

1

Exploring React

Seems like I've been exploring a lot these days. That means I've to settle down and build actual projects. So, this time it's the all popular React. I must say, I imagine writing components for every little thing that needs to get done. At the end, My project would have >= 80 JS files. ๐Ÿ˜… Just Kidding.

But that's just imagination. Right now, I'm still learning the ropes. I understand that components are created either by:

  1. Using class syntax
  2. Using functions which receive props as arguments After creating components, they are rendered using
ReactDOM.render(<Component />, desired-node)
Enter fullscreen mode Exit fullscreen mode

Something a little more real

Let's assume we have a div with id = "test node"

If we want to fix stuff in it using react, it would probably go like this.
class MyComponent extends React.Component {
  constructor (){
    super()
  }
  render (){
    return (
      <div>
        <h1>Just another boring text in a component</h1>
      </div>
    )
  }
};

ReactDOM.render(<MyComponent />, document.querySelector('#test-node'))
Enter fullscreen mode Exit fullscreen mode

I hope I stick to this thing called React. --There are a million websites trying to teach me react--. I probably stick to it.

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, weโ€™ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, weโ€™ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, โ€œnot bad.โ€

Fixing code doesnโ€™t have to be the worst part of your day. Learn how Sentry can help.

Learn more

๐Ÿ‘‹ Kindness is contagious

Please leave a โค๏ธ or a friendly comment on this post if you found it helpful!

Okay