DEV Community

Shishir Bhuiyan
Shishir Bhuiyan

Posted on

Optional parameter in react functional Component

import React from 'react';

const MyComponent = ({ optionalParam = 'Default Value' }) => {
  return (
    <div>
      <p>{optionalParam}</p>
    </div>
  );
};

export default MyComponent;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)