DEV Community

Asif Zubayer Palak
Asif Zubayer Palak

Posted on

Fullstackopen Summary Part 1

This post contains the summary of what I learnt in fullstackopen (Part 1)

  • Creating a react app
npm create vite@latest appname -- --template react
Enter fullscreen mode Exit fullscreen mode
  • Running vite application
npm run dev
Enter fullscreen mode Exit fullscreen mode
  • Export Component
[...create component...]
export default ComponentName
Enter fullscreen mode Exit fullscreen mode
  • Import component
import ComponentName from '../component.jsx'
Enter fullscreen mode Exit fullscreen mode
  • What to render
    The react app cannot render objects

  • How to render objects
    using the map function:

object.map(item => <p>{item}<p>)
Enter fullscreen mode Exit fullscreen mode

works if each item in the object is not an object itself as well.

  • this keyword
    this tells us about what context it was called from.
    if this is called from a reference, it becomes a global object, and if it is called within a function, this refers to the scope of the function.

  • Using props
    Pass it through the component:

<Component prop={variable} />
Enter fullscreen mode Exit fullscreen mode

Using props on the components:

const Component = ({prop1,prop2}) => {
...
}
Enter fullscreen mode Exit fullscreen mode
  • Updating object
const items = {
right: 0,
left: 0
}
const updated = {
...items,
left: items.left + 1
}
Enter fullscreen mode Exit fullscreen mode

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

Best practices for optimal infrastructure performance with Magento

Running a Magento store? Struggling with performance bottlenecks? Join us and get actionable insights and real-world strategies to keep your store fast and reliable.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️