Make sure sandy device plugins are rendered

Summary: Now that we can load device plugins, let's make sure they are rendered as well.

Reviewed By: passy, nikoant

Differential Revision: D22693927

fbshipit-source-id: 22574ec6e629e6dd66e42193b406ceb7dfcf1836
This commit is contained in:
Michel Weststrate
2020-08-04 07:05:57 -07:00
committed by Facebook GitHub Bot
parent 489dd1521e
commit b621dcf754
4 changed files with 163 additions and 18 deletions

View File

@@ -343,18 +343,13 @@ class PluginContainer extends PureComponent<Props, State> {
}
let pluginElement: null | React.ReactElement<any>;
if (isSandyPlugin(activePlugin)) {
if (target instanceof Client) {
// Make sure we throw away the container for different pluginKey!
pluginElement = (
<SandyPluginRenderer
key={pluginKey}
plugin={target.sandyPluginStates.get(activePlugin.id)!}
/>
);
} else {
// TODO: target might be a device as well, support that T68738317
pluginElement = null;
}
// Make sure we throw away the container for different pluginKey!
pluginElement = (
<SandyPluginRenderer
key={pluginKey}
plugin={target.sandyPluginStates.get(activePlugin.id)!}
/>
);
} else {
const props: PluginProps<Object> & {
key: string;