1

This is how my child container declares Ownprops

export interface OwnProps {
    prop1: string;
    prop2: "callback function"
}

I will pass a callback function from parent to this child so that i can trigger the parent function from child.

I am not able to declare it in OwnProps.

I tried this

prop2: React.PropTypes.func

It gave error "React has no exported member PropTypes"

Dennis Vash
  • 50,196
  • 9
  • 100
  • 118
Sallu
  • 116
  • 7

1 Answers1

1

Do you mean you want to use callback types?

If your callback is of type () => void:

interface OwnProps {
  prop1: string;
  prop2: () => void;
}
Dennis Vash
  • 50,196
  • 9
  • 100
  • 118