Skip to content

Instantly share code, notes, and snippets.

@cesarfigueroa
Created September 23, 2018 19:34
Show Gist options
  • Save cesarfigueroa/d5a924abd12a4ca174cbf6f0eafc97f3 to your computer and use it in GitHub Desktop.
Save cesarfigueroa/d5a924abd12a4ca174cbf6f0eafc97f3 to your computer and use it in GitHub Desktop.
Component Without Props in Flow
// @flow
import * as React from 'react';
type ProplessComponent = React.ComponentType<{||}>
const component: ProplessComponent = () => <p>Hello World</p>
React.createElement(component, Object.freeze({}))
React.createElement(component, Object.freeze({ a: 1 })) // Error!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment