Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 8 additions & 3 deletions js_src/_dart_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ function _createReactDartComponentClass2(dartInteropStatics, componentStatics, j
return typeof derivedState !== 'undefined' ? derivedState : null;
}
render() {
// Must call checkPropTypes manually because React moved away from using the `prop-types` package.
// See: https://github.com/facebook/react/pull/18127
// React now uses its own internal cache of errors for PropTypes which broke `PropTypes.resetWarningCache()`.
// Solution was to use `PropTypes.checkPropTypes` directly which makes `PropTypes.resetWarningCache()` work.
// Solution from: https://github.com/facebook/react/issues/18251#issuecomment-609024557
if (process.env.NODE_ENV !== 'production') {
React.PropTypes.checkPropTypes(jsConfig.propTypes, this.props, 'prop', ReactDartComponent2.displayName);
}
var result = dartInteropStatics.handleRender(this.dartComponent, this.props, this.state, this.context);
if (typeof result === 'undefined') result = null;
return result;
Expand All @@ -153,9 +161,6 @@ function _createReactDartComponentClass2(dartInteropStatics, componentStatics, j
if (jsConfig.defaultProps) {
ReactDartComponent2.defaultProps = jsConfig.defaultProps;
}
if (jsConfig.propTypes) {
ReactDartComponent2.propTypes = jsConfig.propTypes;
}
}

return ReactDartComponent2;
Expand Down
23 changes: 0 additions & 23 deletions lib/react.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2780,26 +2780,3 @@ _createDOMComponents(creator) {
view = creator('view');
vkern = creator('vkern');
}

/// Set configuration based on functions provided as arguments.
///
/// The arguments are assigned to global variables, and React DOM `Component`s are created by calling
/// [_createDOMComponents] with [domCreator].
///
/// > __DEPRECATED.__
/// >
/// > Environment configuration is now done by default and should not be altered. This can now be removed.
/// > This will be removed in 6.0.0, along with other configuration setting functions.
@Deprecated(
'Environment configuration is now done by default. You can remove this. Will be removed from this library in the 6.0.0 release.')
void setReactConfiguration(
domCreator,
customRegisterComponent, {
ComponentRegistrar2 customRegisterComponent2,
FunctionComponentRegistrar customRegisterFunctionComponent,
}) {
registerComponent = customRegisterComponent;
registerComponent2 = customRegisterComponent2;
// HTML Elements
_createDOMComponents(domCreator);
}
Loading