Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
flip ReactElement order back
  • Loading branch information
rickyvetter committed Apr 4, 2019
commit 5153dc5cc07c9c153668d7a89cfa98d41d92ab40
26 changes: 17 additions & 9 deletions packages/react/src/ReactElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function defineRefPropWarningGetter(props, displayName) {
* indicating filename, line number, and/or other information.
* @internal
*/
const ReactElement = function(type, props, key, ref, owner, self, source) {
const ReactElement = function(type, key, ref, self, source, owner, props) {
const element = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: REACT_ELEMENT_TYPE,
Expand Down Expand Up @@ -213,7 +213,15 @@ export function jsx(type, config, maybeKey) {
}
}

return ReactElement(type, props, key, ref, ReactCurrentOwner.current);
return ReactElement(
type,
key,
ref,
undefined,
undefined,
ReactCurrentOwner.current,
props,
);
}

/**
Expand Down Expand Up @@ -280,12 +288,12 @@ export function jsxDEV(type, config, maybeKey, source, self) {

return ReactElement(
type,
props,
key,
ref,
ReactCurrentOwner.current,
self,
source,
ReactCurrentOwner.current,
props,
);
}

Expand Down Expand Up @@ -368,12 +376,12 @@ export function createElement(type, config, children) {
}
return ReactElement(
type,
props,
key,
ref,
ReactCurrentOwner.current,
self,
source,
ReactCurrentOwner.current,
props,
);
}

Expand All @@ -395,12 +403,12 @@ export function createFactory(type) {
export function cloneAndReplaceKey(oldElement, newKey) {
const newElement = ReactElement(
oldElement.type,
oldElement.props,
newKey,
oldElement.ref,
oldElement._owner,
oldElement._self,
oldElement._source,
oldElement._owner,
oldElement.props,
);

return newElement;
Expand Down Expand Up @@ -478,7 +486,7 @@ export function cloneElement(element, config, children) {
props.children = childArray;
}

return ReactElement(element.type, props, key, ref, owner, self, source);
return ReactElement(element.type, key, ref, self, source, owner, props);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/forks/ReactFeatureFlags.new-scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ export const enableStableConcurrentModeAPIs = false;
export const warnAboutShorthandPropertyCollision = false;
export const warnAboutDeprecatedSetNativeProps = false;
export const enableEventAPI = false;
export const enableJSXTransformAPI = false;

export const enableNewScheduler = true;
export const enableJSXTransformAPI = false;