Import type additional syntax

# somonek (8 years ago)

Hello,

no research produced me an answer to this combined import syntax

import { connect, type Dispatch, } from 'react-redux';

Is this valid?

It's great to avoid duplicating it like this

import type { Dispatch } from 'react-redux'; import { connect } from 'react-redux';

My IDE marks it as an error but the code works.

Thanks

Serghei

# Jordan Harband (8 years ago)

JS doesn't have types in this way. Are you perhaps using Flow or TypeScript?

# Logan Smyth (8 years ago)

If you're using Flowtype, that syntax was added in version 0.38 facebook/flow/blob/master/Changelog.md#v0380 in January, so it may be that your IDE version does not support it since it is relatively new.

# somonek (8 years ago)

Yes, I'm using flow type. I guess this is not the right group to discuss that then. Thanks Logan for clarifying it though.