Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Composer/packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"@types/reach__router": "^1.2.4",
"@types/react": "16.9.23",
"@types/react-dom": "16.9.5",
"@types/webpack-env": "^1.15.2",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.1.0",
"babel-loader": "8.0.5",
Expand Down
36 changes: 28 additions & 8 deletions Composer/packages/client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import './index.css';
import { App } from './App';
import { StoreProvider } from './store';

const appHostElm = document.getElementById('root');

formatMessage.setup({
missingTranslation: 'ignore',
});
Expand All @@ -20,11 +22,29 @@ const emotionCache = createCache({
nonce: window.__nonce__,
});

ReactDOM.render(
<CacheProvider value={emotionCache}>
<StoreProvider>
<App />
</StoreProvider>
</CacheProvider>,
document.getElementById('root')
);
/**
* Renders the React App module.
*/
const renderApp = (AppComponent: typeof App) => {
ReactDOM.render(
<CacheProvider value={emotionCache}>
<StoreProvider>
<AppComponent />
</StoreProvider>
</CacheProvider>,
appHostElm
);
};

// Rendering the App for the first time.
renderApp(App);

/**
* Re-render updated App Module when hot module notifies a change.
*/
if (module.hot) {
module.hot.accept('./App', () => {
const NextApp = require<{ App: typeof App }>('./App').App;
renderApp(NextApp);
});
}
5 changes: 5 additions & 0 deletions Composer/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3974,6 +3974,11 @@
resolved "https://botbuilder.myget.org/F/botbuilder-declarative/npm/@types/vscode/-/@types/vscode-1.40.0.tgz#47d19e9e32da512c986f579fe6afbc8d3e6e0c55"
integrity sha1-R9GenjLaUSyYb1ef5q+8jT5uDFU=

"@types/webpack-env@^1.15.2":
version "1.15.2"
resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.15.2.tgz#927997342bb9f4a5185a86e6579a0a18afc33b0a"
integrity sha512-67ZgZpAlhIICIdfQrB5fnDvaKFcDxpKibxznfYRVAT4mQE41Dido/3Ty+E3xGBmTogc5+0Qb8tWhna+5B8z1iQ==

"@types/webpack-sources@*":
version "0.1.5"
resolved "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-0.1.5.tgz#be47c10f783d3d6efe1471ff7f042611bd464a92"
Expand Down