Skip to content
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

Property .data not properly set on createIsomorphicEventClass() #50

Open
flut1 opened this issue Feb 19, 2020 · 0 comments · May be fixed by #51
Open

Property .data not properly set on createIsomorphicEventClass() #50

flut1 opened this issue Feb 19, 2020 · 0 comments · May be fixed by #51

Comments

@flut1
Copy link
Contributor

flut1 commented Feb 19, 2020

There's something going wrong with the constructor of the class returned by createIsomophicEventClass() once compiled. The constructor of the base class BaseEvent sets the .data property, but somehow this is still undefined on the resulting event instance.

Added failing test to branch bug-isomorphic-event-data

flut1 added a commit that referenced this issue Feb 19, 2020
Set the .data property again (even though it's already defined
in the base class). This is related to this issue:
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#the-usedefineforclassfields-flag-and-the-declare-property-modifier

It seems to be that things are running fine when compiling, but
if running in jest or ts-node, the behavior described in
useDefineForClassFields will be used instead. This will cause
the specialization of the data property to a sub-type in
IsomorphicBaseEvent to actually re-declare the property as
undefined.

Closes #50
@flut1 flut1 linked a pull request Feb 19, 2020 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant