File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/js/packages/@reactpy/client/src Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ function useImportSource(model: ReactPyVdom): MutableRefObject<any> {
175175 const mountPoint = useRef < HTMLElement > ( null ) ;
176176 const client = useContext ( ClientContext ) ;
177177 const [ binding , setBinding ] = useState < ImportSourceBinding | null > ( null ) ;
178+ const bindingSource = useRef < string | null > ( null ) ;
178179
179180 useEffect ( ( ) => {
180181 let unmounted = false ;
@@ -184,6 +185,7 @@ function useImportSource(model: ReactPyVdom): MutableRefObject<any> {
184185 loadImportSource ( vdomImportSource , client ) . then ( ( bind ) => {
185186 if ( ! unmounted && mountPoint . current ) {
186187 currentBinding = bind ( mountPoint . current ) ;
188+ bindingSource . current = vdomImportSourceJsonString ;
187189 setBinding ( currentBinding ) ;
188190 }
189191 } ) ;
@@ -206,6 +208,9 @@ function useImportSource(model: ReactPyVdom): MutableRefObject<any> {
206208 if ( ! ( binding && vdomImportSource ) ) {
207209 return ;
208210 }
211+ if ( bindingSource . current !== vdomImportSourceJsonString ) {
212+ return ;
213+ }
209214 binding . render ( model ) ;
210215 if ( vdomImportSource . unmountBeforeUpdate ) {
211216 return binding . unmount ;
You can’t perform that action at this time.
0 commit comments