+z      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnop q r s t u v w x y z { | } ~                              None034579;>CLN None034579;>CLN ]An existential type for some store action. It is used as the output of the dispatcher. The > instance is important for performance, for details see below.:The data in a store must be an instance of this typeclass.#The actions that this store accepts]Transform the store data according to the action. This is the only place in your app where IO should occur. The transform function should complete quickly, since the UI will not be re-rendered until the transform is complete. Therefore, if you need to perform some longer action, you should fork a thread from inside . The thread can then call { with another action with the result of its computation. This is very common to communicate with the backend using AJAX.Note that if the transform throws an exception, the transform will be aborted and the old store data will be kept unchanged. The exception will then be thrown from .For the best performance, care should be taken in only modifying the part of the store data that changed (see below for more information on performance).<A store contains application state, receives actions from the dispatcher, and notifies controller-views to re-render themselves. You can have multiple stores; it should be the case that all of the state required to render the page is contained in the stores. A store keeps a global reference to a value of type  storeData, which must be an instance of .Stores also work when compiled with GHC instead of GHCJS. When compiled with GHC, the store is just an MVar containing the store data and there are no controller views. ! can still be used, but it just s the store and does not notify any controller-views since there are none. Compiling with GHC instead of GHCJS can be helpful for unit testing, although GHCJS plus node can also be used for unit testing.  data Todo = Todo { todoText :: String , todoComplete :: Bool , todoIsEditing :: Bool } deriving (Show, Typeable) newtype TodoState = TodoState { todoList :: [(Int, Todo)] } deriving (Show, Typeable) data TodoAction = TodoCreate String | TodoDelete Int | TodoEdit Int | UpdateText Int String | ToggleAllComplete | TodoSetComplete Int Bool | ClearCompletedTodos deriving (Show, Typeable, Generic, NFData) instance StoreData TodoState where type StoreAction TodoState = TodoAction transform action (TodoState todos) = ... todoStore :: ReactStore TodoState todoStore = mkStore $ TodoState [ (0, Todo "Learn react" True False) , (1, Todo "Learn react-flux" False False) ]8A reference to the foreign javascript part of the store.An MVar containing the current store data. Normally, the MVar is full and contains the current store data. When applying an action, the MVar is kept empty for the entire operation of transforming to the new data and sending the new data to all component views. This effectively operates as a lock allowing only one thread to modify the store at any one time. This lock is safe because only the  function ever writes this MVar.OThis type is used to represent the foreign javascript object part of the store.XObtain the store data from a store. Note that the store data is stored in an MVar, so  can block since it uses . The  is empty exactly when the store is being transformed, so there is a possiblity of deadlock if two stores try and access each other's data during transformation.)Create a new store from the initial data.First,  the store data according to the given action. Next, if compiled with GHCJS, notify all registered controller-views to re-render themselves. (If compiled with GHC, the store data is just transformed since there are no controller-views.)gOnly a single thread can be transforming the store at any one time, so this function will block on an C waiting for a previous transform to complete if one is in process. Call  on the store and action.    None034579;>CLN A writer monad for  7s which is used in the rendering function of all views.do notation or the  instance is used to sequence sibling elements. Child elements are specified via function application; the combinator creating an element takes the child element as a parameter. The OverloadedStrings( extension is used to create plain text. kul_ $ do li_ (b_ "Hello") li_ "World" li_ $ ul_ (li_ "Nested" <> li_ "List")would build something like p<ul> <li><b>Hello</b><li> <li>World</li> <li><ul> <li>Nested</li> <li>List</li> </ul></li> </ul>The React.Flux.DOMJ module contains a large number of combinators for creating HTML elements. A React element is a node or list of nodes in a virtual tree. Elements are the output of the rendering functions of classes. React takes the output of the rendering function (which is a tree of elements) and then reconciles it with the actual DOM elements in the browser. The   is a monoid, so dispite its name can represent more than one element. Multiple elements are rendered into the browser DOM as siblings./Keys in React can either be strings or integers&Either a property or an event handler.The combination of all properties and event handlers are used to create the javascript object passed as the second argument to React.createElement.#will be passed this.context0>The first parameter of an event handler registered with React.2%This type is for the return value of React.createElement5%This type is for the return value of React.createClass8@Create a property from anything that can be converted to a JSVal9 Create a   containing a given  .:;Create a text element from a string. This is an alias for _. The text content is escaped to be HTML safe. If you need to insert HTML, instead use the  Ehttps://facebook.github.io/react/tips/dangerously-set-inner-html.htmldangerouslySetInnerHTML property.;9Create an element containing text which is the result of Ring the argument. Note that the resulting string is then escaped to be HTML safe.<Create a React element.=$Transclude the children passed into   or  < into the current rendering. Use this where you would use this.props.children in a javascript React class.>Execute a ReactElementM to create a javascript React element and a list of callbacks attached to nodes within the element. These callbacks will need to be released with releaseCallback once the class is re-rendered.I  !"#$%&'()*+,-./0123456789:;<(The element name (the first argument to React.createElement).>The properties to pass to the element (the second argument to React.createElement).*The child elements (the third argument to React.createElement).=> this.contextthis.props.children?6  !"#$%&'()*+,-./0123456789:;<=>?656723401!$'*- "#%&()+,./8  :;<=9>?"  !$'*- "#%&()+,./0123456789:;<=>?None034579;>CLN @A stateful-view event handler produces a list of store actions and potentially a new state. If the new state is nothing, no change is made to the state (which allows an optimization in that we do not need to re-render the view).Changing the state causes a re-render which will cause a new event handler to be created. If the handler closes over the state passed into the rendering function, there is a race if multiple events occur before React causes a re-render. Therefore, the handler takes the current state as input. Your handlers therefore should ignore the state passed into the render function and instead use the state passed directly to the handler.ArEvent handlers in a controller-view and a view transform events into actions, but are not allowed to perform any .B1A view is conceptually a rendering function from propsX and some internal state to a tree of elements. The function receives a value of type props from its parent in the virtual DOM. Additionally, the rendering function can depend on some internal state or store data. Based on the props and the internal state, the rendering function produces a virtual tree of elements which React then reconciles with the browser DOM.This module supports 3 kinds of views. All of the views provided by this module are pure, in the sense that the rendering function and event handlers cannot perform any IO. All IO occurs inside the  function of a store.C.A controller view provides the glue between a  and the DOM. The controller-view registers with the given store, and whenever the store is transformed the controller-view re-renders itself. Each instance of a controller-view also accepts properties of type props from its parent. Whenever the parent re-renders itself, the new properties will be passed down to the controller-view causing it to re-render itself.GEvents registered on controller-views are expected to produce lists of . Since lists of R are the output of the dispatcher, each event handler should just be a call to a dispatcher function. Once the event fires, the actions are executed causing the store(s) to transform which leads to the controller-view(s) re-rendering. This one-way flow of data from actions to store to controller-views is central to the flux design.It is recommended to have one controller-view for each significant section of the page. Controller-views deeper in the page tree can cause complexity because data is now flowing into the page in multiple possibly conflicting places. You must balance the gain of encapsulated components versus the complexity of multiple entry points for data into the page. Note that multiple controller views can register with the same store. todoApp :: ReactView () todoApp = defineControllerView "todo app" todoStore $ \todoState () -> div_ $ do todoHeader_ mainSection_ todoState todoFooter_ todoStateDMA view is a re-usable component of the page which accepts properties of type propsG from its parent and re-renders itself whenever the properties change.KOne option to implement views is to just use a Haskell function taking the props as input and producing a  ?. For small views, such a Haskell function is ideal. Using a BP provides more than just a Haskell function when used with a key property with G`. The key property allows React to more easily reconcile the virtual DOM with the browser DOM.$The following is two example views:  mainSection_ is just a Haskell function and todoItem is a React view. We use the convention that an underscore suffix signifies a combinator which can be used in the rendering function. mainSection_ :: TodoState -> ReactElementM ViewEventHandler () mainSection_ st = section_ ["id" $= "main"] $ do input_ [ "id" $= "toggle-all" , "type" $= "checkbox" , "checked" $= if all (todoComplete . snd) $ todoList st then "checked" else "" , onChange $ \_ -> dispatchTodo ToggleAllComplete ] label_ [ "htmlFor" $= "toggle-all"] "Mark all as complete" ul_ [ "id" $= "todo-list" ] $ mapM_ todoItem_ $ todoList st todoItem :: ReactView (Int, Todo) todoItem = defineView "todo item" $ \(todoIdx, todo) -> li_ [ classNames [("completed", todoComplete todo), ("editing", todoIsEditing todo)] , "key" @= todoIdx ] $ do div_ [ "className" $= "view"] $ do input_ [ "className" $= "toggle" , "type" $= "checkbox" , "checked" @= todoComplete todo , onChange $ \_ -> dispatchTodo $ TodoSetComplete todoIdx $ not $ todoComplete todo ] label_ [ onDoubleClick $ \_ _ -> dispatchTodo $ TodoEdit todoIdx] $ elemText $ todoText todo button_ [ "className" $= "destroy" , onClick $ \_ _ -> dispatchTodo $ TodoDelete todoIdx ] mempty when (todoIsEditing todo) $ todoTextInput_ TextInputArgs { tiaId = Nothing , tiaClass = "edit" , tiaPlaceholder = "" , tiaOnSave = dispatchTodo . UpdateText todoIdx , tiaValue = Just $ todoText todo } todoItem_ :: (Int, Todo) -> ReactElementM eventHandler () todoItem_ todo = viewWithKey todoItem (fst todo) todo memptyEA stateful view is a re-usable component of the page which keeps track of internal state. Try to keep as many views as possible stateless. The React documentation on  Hhttps://facebook.github.io/react/docs/interactivity-and-dynamic-uis.htmlinteractivity and dynamic UIsF has some discussion of what should and should not go into the state.lThe rendering function is a pure function of the state and the properties from the parent. The view will be re-rendered whenever the state or properties change. The only way to transform the internal state of the view is via an event handler, which can optionally produce new state. Any more complicated state should be moved out into a (possibly new) store. _data TextInputArgs = TextInputArgs { tiaId :: Maybe String , tiaClass :: String , tiaPlaceholder :: String , tiaOnSave :: String -> [SomeStoreAction] , tiaValue :: Maybe String } deriving (Typeable) todoTextInput :: ReactView TextInputArgs todoTextInput = defineStatefulView "todo text input" "" $ \curText args -> input_ $ maybe [] (\i -> ["id" @= i]) (tiaId args) ++ [ "className" @= tiaClass args , "placeholder" @= tiaPlaceholder args , "value" @= curText , "autoFocus" @= True , onChange $ \evt _ -> ([], Just $ target evt "value") , onBlur $ \_ _ curState -> if not (null curState) then (tiaOnSave args curState, Just "") else ([], Nothing) , onKeyDown $ \_ evt curState -> if keyCode evt == 13 && not (null curState) -- 13 is enter then (tiaOnSave args curState, Just "") else ([], Nothing) ] todoTextInput_ :: TextInputArgs -> ReactElementM eventHandler () todoTextInput_ args = view todoTextInput args memptyFCreate an element from a view. I suggest you make a combinator for each of your views, similar to the examples above such as  todoItem_.GoCreate an element from a view, and also pass in a key property for the instance. Key properties speed up the  9https://facebook.github.io/react/docs/reconciliation.htmlreconciliation of the virtual DOM with the DOM. The key does not need to be globally unqiue, it only needs to be unique within the siblings of an element.H Create a  * for a class defined in javascript. See , for a convenient wrapper and some examples. @ABC=A name for this view, used only for debugging/console logging0The store this controller view should attach to.The rendering functionD=A name for this view, used only for debugging/console loggingThe rendering functionE=A name for this view, used only for debugging/console loggingThe initial stateThe rendering functionFthe view5the properties to pass into the instance of this viewThe children of the elementGthe view2A value unique within the siblings of this element+The properties to pass to the view instanceThe children of the viewH%The javascript reference to the classHproperties and handlers to pass when creating an instance of this class.The child element or elements @ABCDEFGH @ABCDEFGHNone034579;>CLNv The data for the keyboard eventsThe actions for the fake storeIn a hack, the prevent default and stop propagation are actions since that is the easiest way of allowing users to specify these actions (IO is not available in view event handlers). We create a fake store to handle these actions.[Every event in React is a synthetic event, a cross-browser wrapper around the native event.6A reference to the object that dispatched the event. =https://developer.mozilla.org/en-US/docs/Web/API/Event/target#A class which is used to implement  https://wiki.haskell.org/Varargsvariable argument functions/. Any function where each argument implements  and the result is either A or @ is an instance of this class.tSome third-party React classes allow passing React elements as properties. This function will first run the given  m to obtain an element or elements, and then use that element as the value for a property with the given key.Allows you to create nested object properties. The list of properties passed in will be converted to an object which is then set as the value for a property with the given name. For example, Q[ nestedProperty "Hello" [ "a" @= (100 :: Int), "b" $= "World" ] , "c" $= "!!!" ] would create a javascript object +{"Hello": {a: 100, b: "World"}, "c": "!!!"}Create a callback property. This is primarily intended for foreign React classes which expect callbacks to be passed to them as properties. For events on DOM elements, you should instead use the handlers below. The function funcR can be any function, as long as each argument to the function is an instance of # and the result of the function is handler. Internally, 3 creates a javascript function which accesses the  arguments0 javascript object and then matches entries in  arguments to the parameters of func. If func* has more parameters than the javascript  argumentsB object, a javascript null is used for the conversion. Since the  instance of  converts a null reference to I, you can exploit this to create variable-argument javascript callbacks.EFor example, all three of the following functions could be passed as func inside a view. mfoo :: Int -> Maybe String -> ViewEventHandler bar :: Aeson.Value -> ViewEventHandler baz :: ViewEventHandler1For another example, see the haddock comments in React.Flux.Addons.Bootstrap.Create a property.kCreate a text-valued property. This is here to avoid problems when OverloadedStrings extension is enabledSet the  Bhttps://facebook.github.io/react/docs/class-name-manipulation.html className property to consist of all the names which are matched with True, allowing you to easily toggle class names based on a computation.$Access a property in an event target A version of  which accesses the property of , in the event. This is useful for example: xdiv_ $ input_ [ "type" @= "checked" , onChange $ \evt -> let val = target evt "value" in ... ]In this case, val/ would coorespond to the javascript expression evt.target.value.Use this to create an event handler for an event not covered by the rest of this module. At the moment, this is just the media events (onPlay, onPause, etc.) on image and video tags.KConstruct a handler from a detail parser, used by the various events below.The fake store, doesn't store any data. Also, the dispatch function correctly detects nullRef and will not attempt to notify any controller-views.KPrevent the default browser action from occuring in response to this event.}Stop propagating this event, either down the DOM tree during the capture phase or up the DOM tree during the bubbling phase.By default, the handlers below are triggered during the bubbling phase. Use this to switch them to trigger during the capture phase.jThe onChange event is special in React and should be used for all input change events. For details, see 0https://facebook.github.io/react/docs/forms.htmlWInitialize touch events is only needed with React 0.13, in version 0.14 it was removed.IJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~The event name6A function parsing the details for the specific event.&The function implementing the handler.{8IJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~{8vwxyz{|}~stucdefghijklmnopqrYZ[\]^_`abOPQRSTUVWXIJKLMNZIJKLMNO PQRSTUVWXY Z[\]^_`abcdefghijklmnopqrstuv wxyz{|}~ None034579;>CLNzThis class allows the DOM combinators to optionally take a list of properties or handlers, or for the list to be omitted.      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGH      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFHG      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEF      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHNone034579;>CLNIA wrapper around H that looks up the class on the windowK. I use it for several third-party react components. For example, with < $https://github.com/rackt/react-modal react-modal>, assuming `window.Modal`( contains the definition of the classes, foreign_ "Modal" [ "isOpen" @= isModelOpen myProps , callback "onRequestClose" $ dispatch closeModel , "style" @= Aeson.object [ "overlay" @= Aeson.object ["left" $= "50%", "right" $= "50%"]] ] $ do h1_ "Hello, World!" p_ "...."Here is another example using  )https://github.com/JedWatson/react-select react-select: reactSelect_ :: [PropertyOrHandler eventHandler] -> ReactElementM eventHandler () reactSelect_ props = foreign_ "Select" props mempty someView :: ReactView () someView = defineView "some view" $ \() -> reactSelect_ [ "name" $= "form-field-name" , "value" $= "one" , "options" @= [ object [ "value" .= "one", "label" .= "One" ] , object [ "value" .= "two", "label" .= "Two" ] ] , callback "onChange" $ \(i :: String) -> dispatch $ ItemChangedTo i ]JA  with the given class name (multiple classes can be separated by spaces). This is useful for defining rows and columns in your CSS framework of choice. I use  http://purecss.io/forms/Pure CSS so I use it something like: cldiv_ "pure-g" $ do cldiv_ "pure-u-1-3" $ p_ "First Third" cldiv_ "pure-u-1-3" $ p_ "Middle Third" cldiv_ "pure-u-1-3" $ p_ "Last Third"You should consider writing something like the following for the various components in your frontend of choice. In PureCSS, I use: prow_ :: ReactElementM handler a -> ReactElementM handler a prow_ = cldiv_ "pure-g" pcol_ :: String -> ReactElementM handler a -> ReactElementM handler a pcol_ cl = cldiv_ (unwords $ map ("pure-u-"++) $ words cl)KA  with the given class names and  handler. wclbutton_ ["pure-button button-success"] (dispatch LaunchMissiles) $ do faIcon_ "rocket" "Launch the missiles!"LA  and an B together. Useful for laying out forms. For example, a stacked  http://purecss.io/forms/ Pure CSS Form could be %form_ ["className" $= "pure-form pure-form-stacked"] $ fieldset_ $ do legend_ "A stacked form" labeledInput_ "email" "Email" ["type" $= "email"] labeledInput_ "password" ($(message "password-label" "Your password") []) ["type" $= "password"] The second L shows an example using React.Flux.Addons.Intl.MA  *http://fortawesome.github.io/Font-Awesome/ Font AwesomeT icon. The given string is prefixed by `fa fa-` and then used as the class for an i+ element. This allows you to icons such as faIcon_ "fighter-jet" -- produces <i class="fa fa-fighter-jet"> faIcon_ "refresh fa-spin" -- produces <i class="fa fa-refresh fa-spin">I)this should be the name of a property on window which contains a react class. propertieschildrenJKclass names separated by spaces"the onClick handler for the button the childrenLthe ID for the input element)the label content. This is wrapped in a  with a htmlFor! property equal to the given ID.the properties to pass to . A property with key % is added to this list of properties.MIJKLMKJMILIJKLMNone034579;>CLN NThe class rendering function, together with optional callbacks for the various lifecycle events. As mentioned above, care must be taken in each callback to write only IO that will not block.S&Receives the new props as an argument.TcReceives the new props and state as arguments. The current props and state can be accessed using \.UcReceives the old props and state as arguments. The current props and state can be accessed using \WSet the state of the class.XHObtain the browser DOM element for either the component as a whole with Z$ or for various nodes with a given  :https://facebook.github.io/react/docs/more-about-refs.htmlref property with [.\3Actions to access the current properties and state.`A default configuration, which does not specify any lifecycle events. You should start with this and override the functions you need.a5Create a lifecycle view from the given configuration. myView :: ReactView String myVew = defineLifecycleView "my view" (10 :: Int) lifecycleConfig { lRender = \state props -> ... , lComponentWillMount = \propsAndState setStateFn -> ... }NOPQRSTUVWXYZ[\]^_`aNOPQRSTUVWXYZ[\]^_`aa`NOPQRSTUV\]^_XYZ[WNOPQRSTUVWXYZ[\]^_`aNone034579;>CLNb@Render your React application into the DOM. Use this from your main# function, and only in the browser.c7Render your React application to a string using either React.renderToString$ if the first argument is false or React.renderToStaticMarkupT if the first argument is true. Use this only on the server when running with node.bVThe ID of the HTML element to render the application into. (This string is passed to document.getElementById))A single instance of this view is created"the properties to pass to the viewcfRender to static markup? If true, this won't create extra DOM attributes that React uses internally.)A single instance of this view is created"the properties to pass to the view" 8:;=@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFIJKLMbc BCDEA@ :;FG=HbcbcNone034579;>CLNdGAn action to start or stop performance measurement. For details, see  /https://facebook.github.io/react/docs/perf.html.g<What to print after stopping performance measurement. See  /https://facebook.github.io/react/docs/perf.html for documentation.lThe  4https://facebook.github.io/react/docs/animation.htmlReactCSSTransitionGroup% element. For example in React 0.14, cssTransitionGroup ["transitionName" $= "example", transitionAppear @= True, transitionAppearTimeout @= (100 :: Int)] $ h1_ "Fading at initial mount"mSConvert a performance action into a store action. Use this if you are not using n."The performance toggle button viewnA button which when clicked toggles the performance measurement on and off. When the measurement is stopped, the given measurements are printed. If you want more control over the performance tools, you can use m' directly from your own event handlers.defghijklmn defghijklmn ldefghijknm defghijklmnNone034579;>CLNo A bootstrap  0http://react-bootstrap.github.io/components.html component. For example, bootstrap_ "Alert" [ "bsStyle" $= "danger" , callback "onDismiss" $ dispatch CloseAlert ] $ p_ "Hello, World!" bootstrap_ "Nav" [ "activeKey" @= (1 :: Int) , callback "onSelect" $ \(i :: Int) -> dispatch $ TabChange i ] $ do bootstrap_ "NavItem" ["eventKey" @= (1 :: Int)] "Item 1" bootstrap_ "NavItem" ["eventKey" @= (2 :: Int)] "Item 2" bootstrap_ "NavItem" ["eventKey" @= (3 :: Int)] "Item 3"oThe component name. Uses window['ReactBootstrap'][name]A to find the class, so the name can be anything exported to the window.ReactBoostrap object.KProperties and callbacks to pass to the ReactBootstrap class. You can use  to create function properties.'The child or children of the component.ooo None034579;>CLN.;This is the type stored in the Q monad with qGetQ and qPutQp A message.r:A description intended to provide context for translators.sThe default message written in  )http://formatjs.io/guides/message-syntax/ICU message syntax.t5An identifier for a message, must be globally unique.upHow to display a time. Each non-Nothing component will be displayed while Nothing components will be ommitted.>These properties coorespond directly the options accepted by  _https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormatIntl.DateTimeFormat.w'possible values are numeric and 2-digitx'possible values are numeric and 2-digity'possible values are numeric and 2-digitz"possible values are short and long{How to display a date. Each non-Nothing component will be displayed while the Nothing components will be ommitted. If everything is nothing, then it is assumed that year, month, and day are each numeric.>These properties coorespond directly the options accepted by  _https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormatIntl.DateTimeFormat.}+possible values are narrow, short, and long~+possible values are narrow, short, and long'possible values are numeric and 2-digit=possible values are numeric, 2-digit, narrow, short, and long'possible values are numeric and 2-digit Use the IntlProvider to set the locale, formats, and messages property.Format an integer using  and the default style.Format a double using  and the default style.A  *http://formatjs.io/react/#formatted-numberFormattedNumber which allows arbitrary properties and therefore allows control over the style and format of the number. The accepted properties are any options supported by  ]https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormatIntl.NumberFormat.KFormat a number as a string, and then use it as the value for a property. , , or h should be prefered because as components they can avoid re-rendering when the number has not changed. z is needed if the formatted number has to be a property on another element, such as the placeholder for an input element.<Convert a format to the properties accepted by FormattedDateJA short day format, where month is "short" and year and day are "numeric".AConvert a time format to properties for the FormattedDate element&A default date and time format, using 0 and then numeric for hour, minute, and second. Display a  in the given format using the  FormattedDate$ class and then wrap it in a HTML5  >https://developer.mozilla.org/en-US/docs/Web/HTML/Element/timetime element. Display a  using the given format. Despite giving the time in UTC, it will be displayed to the user in their current timezone. In addition, wrap it in a HTML5  >https://developer.mozilla.org/en-US/docs/Web/HTML/Element/timetime element.A raw  (http://formatjs.io/react/#formatted-date FormattedDate@ class which allows custom properties to be passed. The given  or B will be converted to a javascript Date object and passed in the valueA property. The remaining properties can be any properties that  _https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormatIntl.DateTimeFormat` accepts. For example, you could pass in "timeZone" to specify a specific timezone to display.PFormat a day or time as a string, and then use it as the value for a property. , , or f should be prefered because as components they can avoid re-rendering when the date has not changed. x is needed if the formatted date has to be a property on another element, such as the placeholder for an input element. Display the @ as a relative time. In addition, wrap the display in a HTML5  >https://developer.mozilla.org/en-US/docs/Web/HTML/Element/timetime element.#Format the given UTCTime using the  ,http://formatjs.io/react/#formatted-relativeFormattedRelative6 class to display a relative time to now. The given  is passed in the value property. The supported style/formatting properties are "units" which can be one of second, minute, hour, day, month, or year and "style" which if given must be numeric.WFormat a time as a relative time string, and then use it as the value for a property.  or f should be prefered because as components they can avoid re-rendering when the date has not changed. x is needed if the formatted date has to be a property on another element, such as the placeholder for an input element.A simple plural formatter useful if you do not want the full machinery of messages. This does not support translation, for that you must use messages which via the ICU message syntax support pluralization. The properties passed to  must be value0, and then at least one of the properties from other, zero, one, two, few, many._Format a number properly based on pluralization, and then use it as the value for a property.  should be preferred, but f can be used in places where a component is not possible such as the placeholder of an input element.>Utility function to build the properties for FormattedMessage.vRender a message and also record it during compilation. This template haskell splice produces an expression of type B[PropertyOrHandler eventHandler] -> ReactElementM eventHandler ()B, which should be passed the values for the message. For example, Qli_ ["id" $= "some-id"] $ $(message "num_photos" "{name} took {numPhotos, plural, =0 {no photos} =1 {one photo} other {# photos}} {takenAgo}.") [ "name" $= "Neil Armstrong" , "numPhotos" @= (100 :: Int) , elementProperty "takenAgo" $ relativeTo_ (UTCTime (fromGregorian 1969 7 20) (2*60*60 + 56*60)) ]This will first lookup the t (in this case  num_photos ) in the messages parameter passed to . If no messages were passed,  was not called, or the t, was not found, the default message is used.)In my project, I create a wrapper around  which sets the t as the sha1 hash of the message. I did not implement it in react-flux because I did not want to add cryptohash as a dependency. For example, import Crypto.Hash (hash, SHA1) import qualified Data.Text as T import qualified Data.Text.Encoding as T msg :: T.Text -> ExpQ msg txt = message (T.pack $ show (hash (T.encodeUtf8 txt) :: Digest SHA1)) txt Similar to $, but produce an expression of type [] -> PropertyOrHandler handler, which should be passed the values for the message. This allows you to format messages in places where using a component like > is not possible, such as the placeholder of input elements. a should be prefered since it can avoid re-rendering the formatting if the value has not changed. import Data.Aeson ((.=)) input_ [ "type" $= "numeric" , $(messageProp "placeholder" "ageplaceholder" "Hello {name}, enter your age") [ "name" .= nameFrom storeData ] ] A variant of : which allows you to specify some context for translators. A varient of : which allows you to specify some context for translators. Similar to  but use a FormattedHTMLMessageO which allows HTML inside the message. It is recomended that you instead use  together with Q to include rich text inside the message. This splice produces a value of type B[PropertyOrHandler eventHandler] -> ReactElementM eventHandler (), the same as . A variant of 9 that allows you to specify some context for translators.Utility function for messagesPerform an arbitrary IO action on the accumulated messages at compile time, which usually should be to write the messages to a file. Despite producing a value of type Q [Dec]@, no declarations are produced. Instead, this is purly to allow IO to happen. A call to this function should be placed at the bottom of the file, since it only will output messages that appear above the call. Also, to provide consistency, I suggest you create a utility wrapper around this function. For example, {-# LANGUAGE TemplateHaskell #-} module MessageUtil where import Language.Haskell.TH import Language.Haskell.TH.Syntax import React.Flux.Addons.Intl writeMessages :: String -> Q [Dec] writeMessages name = writeIntlMessages (intlFormatJson $ "some/diretory/" ++ name ++ ".json")UNote that all paths in template haskell are relative to the directory containing the .cabal* file. You can then use this as follows: @{-# LANGUAGE TemplateHaskell #-} module SomeViews where import React.Flux import React.Flux.Addons.Intl import MessageUtil someView :: ReactView () someView = defineView .... use $(message) in render ... anotherView :: ReactView () anotherView = defineView ... use $(message) in render ... writeMessages "some-views"EFormat messages as json. The format is an object where keys are the t4s, and the value is an object with two properties, message and optionally  description+. This happens to the the same format as  5https://developer.chrome.com/extensions/i18n-messageschrome, although the syntax of placeholders uses ICU message syntax instead of chrome's syntax. This does not pretty-print the JSON, but I suggest before adding these messages in source control you pretty print and sort by MessageIds so diffs are easy to read. This can be done with the  aeson-pretty7 package, but I did not want to add it as a dependency.dFormat messages as json, ignoring the description. The format is an object where the keys are the t{s and the value is the message string. This format is used by many javascript libraries, so many translation tools exist.Format messages in  Hhttp://developer.android.com/guide/topics/resources/string-resource.html Android XML3 format, but just using strings. String arrays and plurals are handled in the ICU message, instead of in the XML. There are many utilities to translate these XML messages, and the format has the advantage that it can include the descriptions as well as the messages. Also, the messages are sorted by tQ so that if the output is placed in source control the diffs are easy to review.@pqrstuvwxyz{|}~ the locale to useGA reference to translated messages, which must be an object with keys tp and value the translated message. Set this as Nothing if you are not using translated messages, since either NothingJ or a null JSVal will cause the messages from the source code to be used.An object to use for the formats parameter which allows custom formats. I suggest you use custom formats only for messages. Custom formats for numbers and dates not in a message is better done by writing a small Haskell utility function wrapping for example .VThe children of this element. All descendents will use the given locale and messages.the property to setthe number to formatany options accepted by ]https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormatIntl.NumberFormatthe property to setthe day or time to formatAny options supported by  _https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormatIntl.DateTimeFormat.te property to setthe time to formatan object with properties "units" and "style". "units" accepts values second, minute, hour day, month, or year and "style" accepts only the value "numeric".The default message written in  )http://formatjs.io/guides/message-syntax/ICU message syntaxe. This message is used if no translation is found, and is also the message given to the translators.the property name to setthe message identifier2the default message written in ICU message syntax.9A description indented to provide context for translators1The default message written in ICU message syntaxproperty to set9A description intended to provide context for translators1The default message written in ICU message syntax-default message written in ICU message syntax9A description intended to provide context for translators1The default message written in ICU message syntax   ,pqrstuvwxyz{|}~,{|}~uvwxyztpqrs2pqrstuvwxyz{|}~               !"#$%&'()*+,-./0123456789:;<=>>??@AABCDEFGHIJKLMNOP  QRRSTUVWWXYZ[\]^_``abcdefghiijklmnopqrstuvwxxyzz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNNOPQRSTUVWWXYZZ[\]^_`abcdefghijkl m m n o p q q r s t u v v w x y z { | } ~                                M                    react_JXy1y0TocuH6BetyVt34Gj React.FluxReact.Flux.InternalReact.Flux.PropertiesAndEventsReact.Flux.DOMReact.Flux.CombinatorsReact.Flux.LifecycleReact.Flux.Addons.ReactReact.Flux.Addons.BootstrapReact.Flux.Addons.IntlReact.Flux.ExportReact.Flux.Storeview viewWithKeyReact.Flux.Viewsforeign_SomeStoreAction StoreData StoreAction transform ReactStore getStoreDatamkStore alterStore executeAction ReactElementMrunReactElementM ReactElementForeignElementfNamefPropsfChild ViewElementceClassceKeycePropsceChildChildrenPassedToViewContentAppend EmptyElement ReactViewKeytoKeyRefPropertyOrHandlerProperty propertyName propertyValPropertyFromContextpropFromThisNamepropFromThisValNestedPropertynestedPropertyNamenestedPropertyValsElementPropertyelementPropertyName elementValue!CallbackPropertyWithArgumentArraycaPropertyNamecaFunc"CallbackPropertyWithSingleArgumentcsPropertyNamecsFunc HandlerArgReactElementRefreactElementRef ReactViewRef reactViewRefproperty elementToMelemTextelemShowelchildrenPassedToViewmkReactElement toJSStringStatefulViewEventHandlerViewEventHandler ReactViewdefineControllerView defineViewdefineStatefulView foreignClass WheelEventwheelDeltaMode wheelDeltaX wheelDeltaY wheelDeltaZ TouchEvent touchAltKeychangedTouches touchCtrlKeytouchGetModifierState touchMetaKey touchShiftKey touchTargetstouchesTouchtouchIdentifier touchTarget touchScreenX touchScreenY touchClientX touchClientY touchPageX touchPageY MouseEvent mouseAltKey mouseButton mouseButtons mouseClientX mouseClientY mouseCtrlKeymouseGetModifierState mouseMetaKey mousePageX mousePageYmouseRelatedTarget mouseScreenX mouseScreenY mouseShiftKey FocusEventfocusRelatedTarget KeyboardEvent keyEvtAltKeykeyEvtCharCode keyEvtCtrlKeykeyGetModifierStatekeyKeykeyCode keyLocale keyLocation keyMetaKey keyRepeat keyShiftKeykeyWhichEventevtType evtBubbles evtCancelableevtCurrentTargetevtDefaultPreventedevtPhase evtIsTrusted evtTarget evtTimestamp evtHandlerArg EventTargetCallbackFunctionelementPropertynestedPropertycallback@=$= classNameseventTargetProptargetonpreventDefaultstopPropagation capturePhase onKeyDown onKeyPressonKeyUponBluronFocusonChangeonInputonSubmitonClick onContextMenu onDoubleClickonDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStartonDrop onMouseDown onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUpinitializeTouchEvents onTouchCancel onTouchEnd onTouchMove onTouchStartonScrollonWheelonLoadonErrorTermterma_abbr_address_area_article_aside_audio_b_base_bdi_bdo_big_ blockquote_body_br_button_canvas_caption_cite_code_col_ colgroup_data_ datalist_dd_del_details_dfn_dialog_div_dl_dt_em_embed_ fieldset_ figcaption_figure_footer_form_h1_h2_h3_h4_h5_h6_head_header_hr_html_i_iframe_img_input_ins_kbd_keygen_label_legend_li_link_main_map_mark_menu_ menuitem_meta_meter_nav_ noscript_object_ol_ optgroup_option_output_p_param_picture_pre_ progress_q_rp_rt_ruby_s_samp_script_section_select_small_source_span_strong_style_sub_summary_sup_table_tbody_td_ textarea_tfoot_th_thead_time_title_tr_track_u_ul_var_video_wbr_circle_ clipPath_defs_ellipse_g_image_line_linearGradient_mask_path_pattern_polygon_ polyline_radialGradient_rect_stop_svg_text_tspan_,$fTermeventHandlerReactElementMReactElementM$fTermeventHandler[](->)cldiv_ clbutton_ labeledInput_faIcon_LifecycleViewConfiglRenderlComponentWillMountlComponentDidMountlComponentWillReceivePropslComponentWillUpdatelComponentDidUpdatelComponentWillUnmount LSetStateFnLDOMlThislRefLPropsAndState lGetProps lGetStatelifecycleConfigdefineLifecycleView reactRenderreactRenderToString PerfAction PerfStartPerfStopAndPrint PerfPrintPerfPrintInclusivePerfPrintExclusivePerfPrintWasted PerfPrintDOMcssTransitionGroupperfAperfToggleButton_ bootstrap_MessagemsgDescription msgDefaultMsg MessageId TimeFormathourFminuteFsecondF timeZoneNameF DayFormatweekdayFeraFyearFmonthFdayF intlProvider_int_double_formattedNumber_formattedNumberProp shortDate shortDateTimeday_utcTime_formattedDate_formattedDateProp relativeTo_formattedRelative_formattedRelativePropplural_ pluralPropmessage messagePropmessage' messageProp'htmlMsghtmlMsg'writeIntlMessagesintlFormatJson intlFormatJsonWithoutDescriptionintlFormatAndroidXMLdeeps_LbCWUlehDDeLxurARKDH5oControl.DeepSeqNFDatastoreRef storeData ReactStoreRefbaseGHC.MVarreadMVarMVarIsJSValJSVal$fNFDataSomeStoreAction$fIsJSValReactStoreRefGHC.BaseMonoid Data.String fromStringGHC.ShowshowJSArrayToJSValCallback$fIsStringReactElementM$fMonoidReactElementM$fFunctorReactElement$fMonoidReactElement$fReactViewKeyInt$fReactViewKey[]$fFunctorPropertyOrHandler$fShowHandlerArg$fIsJSValHandlerArg$fIsJSValReactElementRef$fIsJSValReactViewRef $fToJSVal() $fToJSValText$fToJSValValueghc-prim GHC.TypesIO reactViewFakeEventStoreActionFakeEventStoreData FromJSValMaybeNothingon2fakeEventStorePreventDefaultStopPropagationapplyFromArgumentsJSStringnullRef parseEventparseKeyboardEventparseFocusEventparseMouseEvent parseTouchparseTouchListparseTouchEventparseWheelEvent js_getPropjs_getArrayProp.:getModifierState arrayLength arrayIndex$fShowTouchEvent$fShowMouseEvent$fShowKeyboardEvent$fNFDataFakeEventStoreAction$fStoreDataFakeEventStoreData$fShowEventTarget$fIsJSValEventTarget$fCallbackFunctionhandler(->)$fCallbackFunction(->)(->)$fCallbackFunction[][]js_lookupWindowid HTMLElementperfToggleButton PerfStoreData perfIsActive perfStorejs_perf$fStoreDataPerfStoreData$fNFDataPerfAction$fNFDataPerfPrint MessageMap dayFtoProps timeFtoPropstime_AXTdBF9VRQoBOqJT6qtmVHData.Time.Calendar.DaysDayData.Time.Clock.UTCUTCTimemessageToPropsaeson_8pJ8mDJSo9R8dbdfpRUa0fData.Aeson.Types.InternalPairformattedMessagejs_intlProviderjs_formatNumber js_formatDatejs_formatRelativejs_formatPlural js_formatMsgjs_formatHtmlMsgdayToRef timeToRef formatCtx recordMessageformatMessageProp escapeForXml