Thanks to visit codestin.com
Credit goes to github.com

Skip to content

v4.0.0-rc2: Record: invalid Flow #1211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
oreqizer opened this issue Apr 15, 2017 · 1 comment
Closed

v4.0.0-rc2: Record: invalid Flow #1211

oreqizer opened this issue Apr 15, 2017 · 1 comment

Comments

@oreqizer
Copy link

oreqizer commented Apr 15, 2017

What happened

Record classes are not correctly recognized as classes. typeof, extending and nominal typing doesn't work correctly and no constructor is found.

How to reproduce

/* @flow */
import { Record } from 'immutable';

const Class = Record({ a: 'asd', b: 123 });

const val = new Class();  // NOPE, no constructor found in RecordClass

class AnotherClass extends Class {
  // NOPE cannot extend
}

Fixed in #1193

@leebyron
Copy link
Collaborator

In general, using new is discouraged for records - those are factory functions. Merged that fix PR, but know that the flow types are less correct in that case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants