You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.
TypeError: this.props.children[0] is not a function
to fix this, use the toChildArray method from preact in the following functions:
Motion.prototype.render = function render() { var children = preact.toChildArray(this.props.children); return children[0](this.state.currentStyle); };
StaggeredMotion.prototype.render = function render() { var children = preact.toChildArray(this.props.children); return children[0](this.state.currentStyles); };
TransitionMotion.prototype.render = function render() { var hydratedStyles = rehydrateStyles(this.state.mergedPropsStyles, this.unreadPropStyles, this.state.currentStyles); var children = preact.toChildArray(this.props.children); return children[0](hydratedStyles); };
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
this.props.children is not guaranteed to be an array and the preact-motion library relies on it being an array.
reference: https://preactjs.com/guide/v10/upgrade-guide/#propschildren-is-not-always-an-array
Error when switching to Preact X:
TypeError: this.props.children[0] is not a function
to fix this, use the toChildArray method from preact in the following functions:
Motion.prototype.render = function render() { var children = preact.toChildArray(this.props.children); return children[0](this.state.currentStyle); };
StaggeredMotion.prototype.render = function render() { var children = preact.toChildArray(this.props.children); return children[0](this.state.currentStyles); };
TransitionMotion.prototype.render = function render() { var hydratedStyles = rehydrateStyles(this.state.mergedPropsStyles, this.unreadPropStyles, this.state.currentStyles); var children = preact.toChildArray(this.props.children); return children[0](hydratedStyles); };
The text was updated successfully, but these errors were encountered: