drcmda / drcmda/react-contextual

"Cannot call class as function" when extending @subscribe'd class?

Open
#35 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
638
Forks
21
PR merge metrics
No merged PRs in 30d

Description

I'm getting an unexpected error when inheriting from a `@subscribe`'d class, can anyone tell me if I'm doing this right?

https://codesandbox.io/s/9ynn07091o

```
import React, { Component } from "react";
import ReactDOM from "react-dom";
import { Provider, subscribe } from "react-contextual";

const props = {
test: "hello"
};

@subscribe()
class A extends Component {
render() {
const { test } = this.props;
return test;
}
}

class B extends A {}

ReactDOM.render(


,
document.getElementById("root")
);
```

```
TypeError
Cannot call a class as a function
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.