Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
init(sdk => {
if (sdk.location.is(locations.LOCATION_DIALOG)) {
renderDialog(sdk);
} else if (sdk.location.is(locations.LOCATION_APP)) {
ReactDOM.render(, document.getElementById('root'));
} else {
ReactDOM.render(, document.getElementById('root'));
}
});
init(sdk => {
const root = document.getElementById('root');
if (sdk.location.is(locations.LOCATION_ENTRY_SIDEBAR)) {
render(, root);
} else if (sdk.location.is(locations.LOCATION_APP)) {
render(, root);
}
});
render() {
const { state, props } = this;
const { sdk } = props;
const { client } = state;
const { location, parameters } = sdk;
if (location.is(locations.LOCATION_APP)) {
return (
);
}
if (location.is(locations.LOCATION_ENTRY_SIDEBAR)) {
if (!parameters.installation.optimizelyProjectId) {
return ;
}
return ;
if (sdk.location.is(locations.LOCATION_ENTRY_FIELD)) {
render(
,
root
);
}
if (sdk.location.is(locations.LOCATION_APP)) {
render(
,
root
);
}
});
}