O'Reilly logo

Cross-platform Desktop Application Development: Electron, Node, NW.js, and React by Dmitry Sheiko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Consuming store from the components

If you were attentive enough, you didn't miss that, in container's JSX, we introduced a new component ErrorAlert. Since we have an error state (state.feedError), we need to visualize it:

./app/ts/Components/ErrorAlert.tsx

 import * as React from "react"; import { Dialog, DialogTitle, DialogContent, DialogActions, Button } from "react-mdl"; import { TStore } from "../Interfaces"; interface IProps { store: TStore; } export default class ErrorAlert extends React.Component<IProps, {}> { private onClose = () => { this.props.store.setFeedError( "" ); } render() { const { feedError } = this.props.store.state; return ( <Dialog open={Boolean(feedError)}> <DialogTitle>Houston, we have a problem</DialogTitle> <DialogContent> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required