Skip to content

Preact + @mui + @emotion - app crashes when open select #4456

Answered by JoviDeCroock
nihil-pro asked this question in Q&A
Discussion options

You must be logged in to vote

This seems to come from

/**
 * @param {unknown[]} oldArgs
 * @param {unknown[]} newArgs
 * @returns {boolean}
 */
function argsChanged(oldArgs, newArgs) {
	return (
		!oldArgs ||
		oldArgs.length !== newArgs.length ||
		newArgs.some((arg, index) => arg !== oldArgs[index])
	);
}

is it possible that the usage of hooks is so that the second argument is missing in their select?

Changing that to

/**
 * @param {unknown[]} oldArgs
 * @param {unknown[]} newArgs
 * @returns {boolean}
 */
function argsChanged(oldArgs, newArgs) {
	return (
		!oldArgs ||
		!newArgs ||
		oldArgs.length !== newArgs.length ||
		newArgs.some((arg, index) => arg !== oldArgs[index])
	

should prevent this crash

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
5 replies
@nihil-pro
Comment options

@JoviDeCroock
Comment options

@nihil-pro
Comment options

@JoviDeCroock
Comment options

@nihil-pro
Comment options

Answer selected by nihil-pro
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@rschristian
Comment options

@nihil-pro
Comment options

@rschristian
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants