mirror of
https://github.com/bendtherules/ts-transformer-visualizer.git
synced 2026-08-18 13:51:48 +00:00
index.tsx - Consume store in component
This commit is contained in:
+13
-2
@@ -3,15 +3,26 @@
|
||||
*/
|
||||
|
||||
import * as React from "react";
|
||||
import { Provider } from "react-redux";
|
||||
import configureStore from "./store";
|
||||
import { initSourceFile, updateSourceFile } from "./store/sourceFiles/actions";
|
||||
|
||||
import styles from "./styles.css";
|
||||
|
||||
export type Props = { text: string };
|
||||
|
||||
export default class ExampleComponent extends React.Component<Props> {
|
||||
const store = configureStore();
|
||||
|
||||
export class ExampleComponent extends React.Component<Props> {
|
||||
render() {
|
||||
const { text } = this.props;
|
||||
|
||||
return <div className={styles.test}>Example Component: {text}</div>;
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<div className={styles.test}>Example Component: {text}</div>
|
||||
</Provider>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export { initSourceFile, updateSourceFile };
|
||||
|
||||
Reference in New Issue
Block a user