Skip to main content
edited body
Source Link
m1kael
  • 2.9k
  • 1
  • 17
  • 14

isActive: getIsActive - this is aliasing of isActive as getIsActive. In the props of the component there's one called isActive, it's extracted by using object destructuring AND renamed locally as getIsActive.

Parenthesis are required here as the jsx markup spans multiple lines. Had it been a single line jsx, no parenthesis would've been needed.

And yes, this is a function (component) that returns jsx markup. This is known as stateless component as it's just a simple function. The opposite would be a full-blown React component that extends `React.Component'React.Component.

isActive: getIsActive - this is aliasing of isActive as getIsActive. In the props of the component there's one called isActive, it's extracted by using object destructuring AND renamed locally as getIsActive.

Parenthesis are required here as the jsx markup spans multiple lines. Had it been a single line jsx, no parenthesis would've been needed.

And yes, this is a function (component) that returns jsx markup. This is known as stateless component as it's just a simple function. The opposite would be a full-blown React component that extends `React.Component'.

isActive: getIsActive - this is aliasing of isActive as getIsActive. In the props of the component there's one called isActive, it's extracted by using object destructuring AND renamed locally as getIsActive.

Parenthesis are required here as the jsx markup spans multiple lines. Had it been a single line jsx, no parenthesis would've been needed.

And yes, this is a function (component) that returns jsx markup. This is known as stateless component as it's just a simple function. The opposite would be a full-blown React component that extends React.Component.

Source Link
m1kael
  • 2.9k
  • 1
  • 17
  • 14

isActive: getIsActive - this is aliasing of isActive as getIsActive. In the props of the component there's one called isActive, it's extracted by using object destructuring AND renamed locally as getIsActive.

Parenthesis are required here as the jsx markup spans multiple lines. Had it been a single line jsx, no parenthesis would've been needed.

And yes, this is a function (component) that returns jsx markup. This is known as stateless component as it's just a simple function. The opposite would be a full-blown React component that extends `React.Component'.