Commit c8c7c81 1 parent 8b8d227 commit c8c7c81 Copy full SHA for c8c7c81
File tree 1 file changed +7
-6
lines changed
packages/sitecore-jss-react/src/components
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,6 @@ import {
12
12
import { convertAttributesToReactProps } from '../utils' ;
13
13
import { HiddenRendering , HIDDEN_RENDERING_NAME } from './HiddenRendering' ;
14
14
15
- /** [SXA] common marker by which we find container fo replacing **/
16
- const PREFIX_PLACEHOLDER = 'container-{*}' ;
17
-
18
15
type ErrorComponentProps = {
19
16
[ prop : string ] : unknown ;
20
17
} ;
@@ -122,9 +119,13 @@ export class PlaceholderCommon<T extends PlaceholderProps> extends React.Compone
122
119
let result ;
123
120
/** [SXA] it needs for deleting dynamics placeholder when we set him number(props.name) of container.
124
121
from backend side we get common name of placeholder is called 'container-{*}' where '{*}' marker for replacing **/
125
- if ( rendering && rendering . placeholders && rendering . placeholders [ PREFIX_PLACEHOLDER ] ) {
126
- rendering . placeholders [ name ] = rendering . placeholders [ PREFIX_PLACEHOLDER ] ;
127
- delete rendering . placeholders [ PREFIX_PLACEHOLDER ] ;
122
+ if ( rendering && rendering . placeholders ) {
123
+ Object . keys ( rendering . placeholders ) . forEach ( ( placeholder ) => {
124
+ if ( placeholder . indexOf ( '{*}' ) !== - 1 ) {
125
+ rendering . placeholders [ name ] = rendering . placeholders [ placeholder ] ;
126
+ delete rendering . placeholders [ placeholder ] ;
127
+ }
128
+ } ) ;
128
129
}
129
130
130
131
if ( rendering && rendering . placeholders && Object . keys ( rendering . placeholders ) . length > 0 ) {
You can’t perform that action at this time.
0 commit comments