Skip to content

Commit

Permalink
Move init and postInit together to show that this doesn't matter
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Apr 8, 2023
1 parent f57beb1 commit 9cb9bb1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/react-dom-bindings/src/client/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,6 @@ export function setInitialProperties(
break;
}
case 'input': {
initInput(domElement, props);
// We listen to this event in case to ensure emulated bubble
// listeners still fire for the invalid event.
listenToNonDelegatedEvent('invalid', domElement);
Expand Down Expand Up @@ -863,11 +862,11 @@ export function setInitialProperties(
// TODO: Make sure we check if this is still unmounted or do any clean
// up necessary since we never stop tracking anymore.
track((domElement: any));
initInput(domElement, props);
postInitInput(domElement, props, false);
return;
}
case 'select': {
initSelect(domElement, props);
// We listen to this event in case to ensure emulated bubble
// listeners still fire for the invalid event.
listenToNonDelegatedEvent('invalid', domElement);
Expand All @@ -890,11 +889,11 @@ export function setInitialProperties(
}
}
}
initSelect(domElement, props);
postInitSelect(domElement, props);
return;
}
case 'textarea': {
initTextarea(domElement, props);
// We listen to this event in case to ensure emulated bubble
// listeners still fire for the invalid event.
listenToNonDelegatedEvent('invalid', domElement);
Expand Down Expand Up @@ -933,6 +932,7 @@ export function setInitialProperties(
// TODO: Make sure we check if this is still unmounted or do any clean
// up necessary since we never stop tracking anymore.
track((domElement: any));
initTextarea(domElement, props);
postInitTextarea(domElement, props);
return;
}
Expand Down Expand Up @@ -2260,13 +2260,13 @@ export function diffHydratedProperties(
listenToNonDelegatedEvent('toggle', domElement);
break;
case 'input':
initInput(domElement, props);
// We listen to this event in case to ensure emulated bubble
// listeners still fire for the invalid event.
listenToNonDelegatedEvent('invalid', domElement);
// TODO: Make sure we check if this is still unmounted or do any clean
// up necessary since we never stop tracking anymore.
track((domElement: any));
initInput(domElement, props);
// For input and textarea we current always set the value property at
// post mount to force it to diverge from attributes. However, for
// option and select we don't quite do the same thing and select
Expand All @@ -2278,19 +2278,19 @@ export function diffHydratedProperties(
validateOptionProps(domElement, props);
break;
case 'select':
initSelect(domElement, props);
// We listen to this event in case to ensure emulated bubble
// listeners still fire for the invalid event.
listenToNonDelegatedEvent('invalid', domElement);
initSelect(domElement, props);
break;
case 'textarea':
initTextarea(domElement, props);
// We listen to this event in case to ensure emulated bubble
// listeners still fire for the invalid event.
listenToNonDelegatedEvent('invalid', domElement);
// TODO: Make sure we check if this is still unmounted or do any clean
// up necessary since we never stop tracking anymore.
track((domElement: any));
initTextarea(domElement, props);
postInitTextarea(domElement, props);
break;
}
Expand Down

0 comments on commit 9cb9bb1

Please sign in to comment.