Use React Context API

This commit is contained in:
uwap 2018-07-22 04:28:20 +02:00
parent 3b78a4d8ad
commit df237ef336
7 changed files with 90 additions and 72 deletions

12
src/mqtt/context.js Normal file
View file

@ -0,0 +1,12 @@
// @flow
import React from "react";
export type MqttContextValue = {
state: State,
changeState: (topic: string, value: string) => void
};
export default React.createContext({
state: {},
changeState: (_topic, _val) => {}
});