UNPKG

bs-react-transition-group

Version:
64 lines (59 loc) 3.12 kB
// Generated by BUCKLESCRIPT VERSION 4.0.5, PLEASE EDIT WITH CARE 'use strict'; var Block = require("bs-platform/lib/js/block.js"); var Curry = require("bs-platform/lib/js/curry.js"); var React = require("react"); var Transition = require("bs-react-transition-group/src/Transition.js"); var ReasonReact = require("reason-react/src/ReasonReact.js"); var component = ReasonReact.reducerComponent("Example"); function make() { return /* record */[ /* debugName */component[/* debugName */0], /* reactClassInternal */component[/* reactClassInternal */1], /* handedOffState */component[/* handedOffState */2], /* willReceiveProps */component[/* willReceiveProps */3], /* didMount */component[/* didMount */4], /* didUpdate */component[/* didUpdate */5], /* willUnmount */component[/* willUnmount */6], /* willUpdate */component[/* willUpdate */7], /* shouldUpdate */component[/* shouldUpdate */8], /* render */(function (self) { return React.createElement("div", undefined, ReasonReact.element(undefined, undefined, Transition.make(self[/* state */1][/* start */0], 600, undefined, undefined, (function (animationState) { if (animationState !== 1) { if (animationState !== 0) { return "State: " + Transition.stringOfState(animationState); } else { return "State: Entering"; } } else { return "State: Entered"; } }))), React.createElement("button", { disabled: self[/* state */1][/* start */0], onClick: (function () { return Curry._1(self[/* send */3], /* Start */0); }) }, "Start Animation"), React.createElement("button", { disabled: !self[/* state */1][/* start */0], onClick: (function () { return Curry._1(self[/* send */3], /* End */1); }) }, "End Animation")); }), /* initialState */(function () { return /* record */[/* start */false]; }), /* retainedProps */component[/* retainedProps */11], /* reducer */(function (action, _) { if (action) { return /* Update */Block.__(0, [/* record */[/* start */false]]); } else { return /* Update */Block.__(0, [/* record */[/* start */true]]); } }), /* jsElementWrapped */component[/* jsElementWrapped */13] ]; } exports.component = component; exports.make = make; /* component Not a pure module */