Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Hotloading TSX files with interfaces does not seem to be working #254

Description

@odinnix

This might be my setup, but hotloading React modules crashes if you reference an interface:

IFormInput.ts

export interface IFormInput
{
   Value?: string;
   OnModelChange?: Function;
   PropertyName?: string;
   ValidationError?: string;
}

React Module

import {IFormInput} from "./IFormInput";

@observer
export default class FormInputGroup extends React.Component<IFormInput, any>
{
 ...trimmed react code
}

Webpack builds everything fine and the application works, however when I make a change and the hotloader fires I get several errors around the interface:

image

Activity

  1. odinnix commented on Aug 11, 2016

    @odinnix
    Author

    I redid how I import things and now it seems to work fine:

    Exporting all components/interfaces in a single file:

    export * from "./Form";
    export * from "./FormTextBox";
    //export * from "./FormDropDown";
    export * from "./FormInputGroup";
    export * from "./FormLabel";
    export * from "./FormSubmitButton";
    export * from "./IFormInput";
    export * from "./IFormModel";
    

    And then importing via:

    import * as FormComponents from '../../Forms/FormImports';

    Seems to fix hotloading.

  2. SteveSandersonMS commented on Aug 15, 2016

    @SteveSandersonMS
    Member

    Glad you got it fixed. I'm not aware of any specific technical issues with using TypeScript that way, but will keep a lookout in case anyone else reports troubles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions