Skip to main content

Command Palette

Search for a command to run...

What is a presentational component in React?

Published
1 min readView as Markdown
What is a presentational component in React?

A presentational component is a component that just renders HTML. The component's only function is presentational markup. In a Redux-powered app, a presentational component does not interact with the Redux store. The presentational component accepts props from a container component , They are sometimes also called dumb components.

1_AcE1ebwNitSyKIDvHtbbhw.png

example: Button.js

import React from 'react';

import classes from './Button.module.css';

const Button = (props) => {
  return (
    <button
      type={props.type || 'button'}
      className={`${classes.button} ${props.className}`}
      onClick={props.onClick}
      disabled={props.disabled}
    >
      {props.children}
    </button>
  );
};

export default Button;

More from this blog

Omar's blog

135 posts