Skip to content

Cannot call a class as a function #17

Description

@valvic66

Hello,

The below component throws error when react-google-maps-loader is upgraded to 4.0.0.
Could you provide some guidance pls.

`export class GoogleAddressInputWrapper extends React.Component {
// tslint:disable-next-line
private component: any;

constructor(props: IGoogleAddressInputProps) {
    super(props);
    this.component = GoogleMapsLoader(GoogleAddressInputComponent, {
        libraries: ['places'],
        key: props.googleApiKey
    });
}

public render() {
    if (this.component == null) {
        return null;
    }

    return <this.component {...this.props} />;
}

}`

Error is:

Cannot call a class as a function TypeError: Cannot call a class as a function at _classCallCheck (http://localhost:6006/static/preview.bundle.js:223503:99) at GoogleMapsLoader (http://localhost:6006/static/preview.bundle.js:223518:5) at new GoogleAddressInputWrapper (http://localhost:6006/static/preview.bundle.js:223473:108) at constructClassInstance (http://localhost:6006/static/preview.bundle.js:73144:20) at updateClassComponent (http://localhost:6006/static/preview.bundle.js:74679:9) at beginWork (http://localhost:6006/static/preview.bundle.js:75325:16) at performUnitOfWork (http://localhost:6006/static/preview.bundle.js:78157:16) at workLoop (http://localhost:6006/static/preview.bundle.js:78186:26) at renderRoot (http://localhost:6006/static/preview.bundle.js:78217:9) at performWorkOnRoot (http://localhost:6006/static/preview.bundle.js:78792:24)

Thanks.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions