Reputation: 1
Here is the code:
const shape = {
id: Prop.Type.string.isRequired,
message: Prop.Type.node.isRequired,
link: Prop.Type.string,
options:Prop.Type.arrayOf(
Prop.Type.shape(NestedDropdown.shape)
)
};
And a screenshot
Upvotes: 0
Views: 36
Reputation: 356
You can't use "const" when defining a field inside a class.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
Fields are defined like this:
class Rectangle {
height = 0;
width;
}
There is some discussion of how to create constants in this thread: Declaring static constants in ES6 classes?
Upvotes: 2