Skip to content

Instantly share code, notes, and snippets.

@tiagobento2
Last active May 9, 2019 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiagobento2/af0f3c7547c756208b2cae1b6af258bc to your computer and use it in GitHub Desktop.
Save tiagobento2/af0f3c7547c756208b2cae1b6af258bc to your computer and use it in GitHub Desktop.
import * as React from "react";
interface Props {
exposing: (self: MyReactComponent) => void;
}
interface State {
someData: any[];
}
class MyReactComponent extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = { someData: [] };
}
public fetchDataAndUpdate() {
//fetches some data and updates state
}
public render() {
return <div>...</div>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment