Import type additional syntax
# Jordan Harband (8 years ago)
JS doesn't have types in this way. Are you perhaps using Flow or TypeScript?
JS doesn't have types in this way. Are you perhaps using Flow or TypeScript? On Wed, May 3, 2017 at 12:29 PM, somonek <somonek at gmail.com> wrote: > 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 > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170503/1195c7ca/attachment.html>
# 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.
If you're using Flowtype, that syntax was added in version 0.38 https://github.com/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. On Wed, May 3, 2017 at 12:42 PM, Jordan Harband <ljharb at gmail.com> wrote: > JS doesn't have types in this way. Are you perhaps using Flow or > TypeScript? > > On Wed, May 3, 2017 at 12:29 PM, somonek <somonek at gmail.com> wrote: > >> 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 >> _______________________________________________ >> es-discuss mailing list >> es-discuss at mozilla.org >> https://mail.mozilla.org/listinfo/es-discuss >> > > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170503/f7510b48/attachment.html>
# 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.
Yes, I'm using flow type. I guess this is not the right group to discuss that then. Thanks Logan for clarifying it though. On Wed, May 3, 2017 at 9:45 PM, Logan Smyth <loganfsmyth at gmail.com> wrote: > If you're using Flowtype, that syntax was added in version 0.38 > https://github.com/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. > > On Wed, May 3, 2017 at 12:42 PM, Jordan Harband <ljharb at gmail.com> wrote: >> >> JS doesn't have types in this way. Are you perhaps using Flow or >> TypeScript? >> >> On Wed, May 3, 2017 at 12:29 PM, somonek <somonek at gmail.com> wrote: >>> >>> 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 >>> _______________________________________________ >>> es-discuss mailing list >>> es-discuss at mozilla.org >>> https://mail.mozilla.org/listinfo/es-discuss >> >> >> >> _______________________________________________ >> es-discuss mailing list >> es-discuss at mozilla.org >> https://mail.mozilla.org/listinfo/es-discuss >> >
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