UNPKG

r-ninja

Version:

r-ninja watches for changes in JSX expressions and updates UI with very less glue code.

24 lines (23 loc) 738 B
import React from "react"; import { Watcher } from "./watcher"; interface MemoProps { render: (watch: Function) => React.ReactNode; } interface MemoState { id: number; } export declare const check: () => void; export declare const NinjaContext: React.Context<Watcher>; export declare class PropsWatcher extends React.Component<MemoProps, MemoState> { private watcher; constructor(props: MemoProps); shouldComponentUpdate(nextProps: any, nextState: any): boolean; componentWillUnmount(): void; refresh: () => void; watch(fn: Function): any; render(): React.FunctionComponentElement<React.ConsumerProps<Watcher>>; } export declare function useWatcher(): { watch: (fn: Function) => any; }; export {};