Faisal Mq
Faisal Mq

Reputation: 5534

Component<{}, {}, State>. What is this Syntax in React?

I am going over Flux Utils TodoMVC example (from Flux GitHub site) and is confused over the following syntax (code brevity here) present in TodoApp.react.js file

class TodoApp extends Component<{}, {}, State> {
 //  ...
 // ....................
}

What does this syntax tell us?

Upvotes: 2

Views: 250

Answers (1)

Andre Pena
Andre Pena

Reputation: 59336

This is Bounded Polymorphism (generics), a feature from FlowType, which Facebook is using on its Flux examples.

Flow files will all have a @flow annotation at the top.

Upvotes: 1

Related Questions