Quantcast
Channel: SOS
Viewing all articles
Browse latest Browse all 57

Using React types with Flow

$
0
0

A little tip for using React types, such as React.Node or React.Element with Flow.  If you import React into a component like

import React from ‘react’;

then Flow will give you the error

Cannot get React.Node because property Node is missing in object type

The fix is to import React as follows

import * as React from ‘react’;


Viewing all articles
Browse latest Browse all 57

Trending Articles