Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type definition for Search Category Layout Renderer is incorrect #4308

Closed
bhbs opened this issue Dec 20, 2021 · 1 comment · Fixed by #4309
Closed

Type definition for Search Category Layout Renderer is incorrect #4308

bhbs opened this issue Dec 20, 2021 · 1 comment · Fixed by #4309
Labels

Comments

@bhbs
Copy link
Contributor

bhbs commented Dec 20, 2021

Bug Report

{layoutRenderer({ categoryContent, resultsContent })}

↓Actually, the argument of this function is a single object, but it is written as two objects in types.

/**
* Renders the SearchCategory layout.
*
* @param {object} categoryContent - The Renderable SearchCategory contents.
* @param {object} resultsContent - The Renderable SearchResult contents.
* @returns {*} - Renderable SearchCategory layout.
*/
layoutRenderer?: (
categoryContent: React.ReactElement<any>,
resultsContent: React.ReactElement<any>,
) => React.ReactElement<any>

↓ Actually, The argument of this function is a single object, but it is written as two objects in JSDoc.

/**
* Renders the SearchCategory layout.
*
* @param {object} categoryContent - The Renderable SearchCategory contents.
* @param {object} resultsContent - The Renderable SearchResult contents.
* @returns {*} - Renderable SearchCategory layout.
*/
categoryLayoutRenderer?: (props: SearchCategoryProps) => React.ReactElement<any>

Expected

Both should be

/** 
 * Renders the SearchCategory layout. 
 * 
 * @param {object} props - The SearchCategoryLayout props object.
 * @returns {*} - Renderable SearchCategory layout. 
 */ 
(props: SearchCategoryLayoutProps) => React.ReactElement<any>

Version

2.0.4

@welcome
Copy link

welcome bot commented Dec 20, 2021

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants