Question: I want to declare default props in a functional component 

normally we would do this

```js
function Body() {
    static defaultProps = {
        counter: 0
    }
    return (
        <div>
            body
        </div>
    );
}

```

this obviously doesn't work

Answer: 
You can do that simply like this

```
const Body = (props) => {
    const {foo = 'defaultValue'} = props;

    return <div>{foo}</div> // It will show defaultValue if props foo is undefined
}

```
This is for hooks but is not intended for functional components.

```
const defaultProps = {
  position: "end"
};

const Dropdown = (props) => {
   // The order of arguments is important.
  props = Object.assign({}, defaultProps, props);
  ...
}

```