diff --git a/preload.js b/preload.js index 94d8bbef8..9477404b3 100644 --- a/preload.js +++ b/preload.js @@ -109,6 +109,13 @@ window.nodeFetch = require('node-fetch'); window.nodeNotifier = require('node-notifier'); window.ProxyAgent = require('proxy-agent'); +// Note: when modifying this file, consider whether our React Components or Backbone Views +// will need these things to render in the Style Guide. If so, go update one of these +// two locations: +// +// 1) test/styleguide/legacy_bridge.js +// 2) ts/test/StyleGuideUtil.js + window.React = require('react'); window.ReactDOM = require('react-dom'); window.moment = require('moment'); diff --git a/ts/test/StyleGuideUtil.ts b/ts/test/StyleGuideUtil.ts index 67b5c07f6..903adcc4b 100644 --- a/ts/test/StyleGuideUtil.ts +++ b/ts/test/StyleGuideUtil.ts @@ -77,7 +77,8 @@ parent.moment.locale(locale); parent.React = React; parent.ReactDOM = ReactDOM; -const SignalComponents: any = parent.Signal.Components = {}; +parent.Signal.Components = { + Message, + Reply, +}; -SignalComponents.Message = Message; -SignalComponents.Reply = Reply;