Skip to content

Commit ce1da9a

Browse files
committed
adjusting renderType to dashRenderType if the dev wants to subscribe, they need to place on the component: namespace.component.dashRenderType = true
1 parent bf00422 commit ce1da9a

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

@plotly/dash-test-components/src/components/RenderType.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ const RenderType = (props) => {
77
}
88

99
return <div id={props.id}>
10-
<span>{props.renderType}</span>
10+
<span>{props.dashRenderType}</span>
1111
<button onClick={onClick}>Test Internal</button>
1212
</div>;
1313
};
1414

1515
RenderType.propTypes = {
1616
id: PropTypes.string,
17-
renderType: PropTypes.string,
17+
dashRenderType: PropTypes.string,
1818
n_clicks: PropTypes.number,
1919
setProps: PropTypes.func
2020
};
21+
22+
RenderType.dashRenderType = true;
2123
export default RenderType;

dash/dash-renderer/src/wrapper/DashWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function DashWrapper({
223223
} as {[key: string]: any};
224224

225225
if (checkRenderTypeProp(component)) {
226-
extraProps['renderType'] = newRender.current
226+
extraProps['dashRenderType'] = newRender.current
227227
? 'parent'
228228
: changedProps
229229
? renderType

dash/dash-renderer/src/wrapper/wrapping.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,12 @@ export function getComponentLayout(
6464

6565
export function checkRenderTypeProp(componentDefinition: any) {
6666
return (
67-
'renderType' in
67+
'dashRenderType' in
6868
pathOr(
6969
{},
7070
[
7171
componentDefinition?.namespace,
7272
componentDefinition?.type,
73-
'propTypes'
7473
],
7574
window as any
7675
)

0 commit comments

Comments
 (0)