Skip to content

Commit 2265268

Browse files
committed
fixup! opt-out of resource semantics when using data attributes
1 parent 629598b commit 2265268

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/react-dom/src/client/ReactDOMFloatResources.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export function isResource(type: string, props: Object): boolean {
212212
if (key) {
213213
// This is potentially a Resource. We need to check if props contain
214214
// data attributes. Resources do not support data attributes.
215-
for (let prop in props) {
215+
for (const prop in props) {
216216
if (prop.startsWith('data-')) {
217217
return false;
218218
}

packages/react-dom/src/server/ReactDOMFloatServer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ export function resourcesFromLink(props: Object): boolean {
413413
// returns false if props object contains any props which invalidate
414414
// treating the element entirely as a Resource
415415
function validateResourceProps(props: Object): boolean {
416-
for (let prop in props) {
416+
for (const prop in props) {
417417
if (prop.toLowerCase().startsWith('data-')) {
418418
return false;
419419
}

0 commit comments

Comments
 (0)