File tree Expand file tree Collapse file tree
packages/react-devtools-shared/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,7 +82,12 @@ describe('editing interface', () => {
8282 shallow = "initial"
8383 />
8484 ,
85- < input ref = { inputRef } onChange = { jest . fn ( ) } value = "initial" />
85+ < input
86+ ref = { inputRef }
87+ onChange = { jest . fn ( ) }
88+ value = "initial"
89+ data-foo = "test"
90+ />
8691 </ > ,
8792 ) ,
8893 ) ;
@@ -259,6 +264,14 @@ describe('editing interface', () => {
259264 } ,
260265 after : 'initial' ,
261266 } ) ;
267+ renamePath ( hostComponentID , [ 'data-foo' ] , [ 'data-bar' ] ) ;
268+ expect ( {
269+ foo : inputRef . current . dataset . foo ,
270+ bar : inputRef . current . dataset . bar ,
271+ } ) . toEqual ( {
272+ foo : undefined ,
273+ bar : 'test' ,
274+ } ) ;
262275 } ) ;
263276
264277 // @reactVersion >= 16.9
Original file line number Diff line number Diff line change @@ -7874,17 +7874,20 @@ export function attach(
78747874 }
78757875 break;
78767876 case 'props':
7877- if (instance === null) {
7878- if (typeof overridePropsRenamePath === 'function') {
7879- overridePropsRenamePath(fiber, oldPath, newPath);
7880- }
7881- } else {
7882- fiber.pendingProps = copyWithRename(
7883- instance.props,
7884- oldPath,
7885- newPath,
7886- );
7887- instance.forceUpdate();
7877+ switch (fiber.tag) {
7878+ case ClassComponent:
7879+ fiber.pendingProps = copyWithRename(
7880+ instance.props,
7881+ oldPath,
7882+ newPath,
7883+ );
7884+ instance.forceUpdate();
7885+ break;
7886+ default:
7887+ if (typeof overridePropsRenamePath === 'function') {
7888+ overridePropsRenamePath(fiber, oldPath, newPath);
7889+ }
7890+ break;
78887891 }
78897892 break;
78907893 case 'state':
You can’t perform that action at this time.
0 commit comments