Skip to content
This repository was archived by the owner on Jun 15, 2026. It is now read-only.

v0.4.0

tagged this 02 Jun 23:19
Compatible with WinJS 4.0.0-preview

The primary change is that most ReactWinJS props now have a prop type
associated with them so warnings will be printed when passing the wrong
data type to a prop.

Other changes:
  - Bug fix: AutoSuggestBox and SearchBox now support onResultSuggestionChosen
    ce84b618de5c7c53f6f2357bb48984a7fee6399d
  - ReactWinJS.reactRenderer was enhanced to work in more scenarios
    252cb38937103bffb205fe33c0e7eda46d76cdc2

Also, 92fb0a3f6e05198767ea4d8a5904aae33451e648 exposed experimental APIs for wrapping
your own WinJS-style controls as React components:
  - defineControl: function for wrapping a WinJS-style control as a React component
  - PropHandlers: Each prop handler describes how a React prop maps onto a WinJS control
    (e.g. is it a property? is it an event?)
  - defaultPropHandlers: An object representing the prop handlers for props that every
    ReactWinJS component supports (e.g. className, style)

  Here's an example of what it would look like to use these APIs to wrap the WinJS.UI.SplitView
  as a React component (MySplitView):

  var MySplitView = ReactWinJS.defineControl({
    displayName: "MySplitView",
    winjsControl: WinJS.UI.SplitView,
    propHandlers: merge(ReactWinJS.defaultPropHandlers, {
      hiddenDisplayMode: ReactWinJS.PropHandlers.property(React.PropTypes.oneOf(["inline", "none"])),
      onAfterHide: ReactWinJS.PropHandlers.event,
      onAfterShow: ReactWinJS.PropHandlers.event,
      onBeforeHide: ReactWinJS.PropHandlers.event,
      onBeforeShow: ReactWinJS.PropHandlers.event,
      paneHidden: ReactWinJS.PropHandlers.property(React.PropTypes.bool),
      panePlacement: ReactWinJS.PropHandlers.property(React.PropTypes.oneOf(["bottom", "left", "right", "top"])),
      shownDisplayMode: ReactWinJS.PropHandlers.property(React.PropTypes.oneOf(["inline", "overlay"])),
      paneComponent: ReactWinJS.PropHandlers.mountTo(function (winjsComponent) {
        return winjsComponent.winControl.paneElement;
      }),
      contentComponent: ReactWinJS.PropHandlers.mountTo(function (winjsComponent) {
        return winjsComponent.winControl.contentElement;
      })
    })
  });

  MySplitView is equivalent to ReactWinJS.SplitView.
Assets 2
Loading