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

Component as props objectOf support. #2207

Merged
merged 11 commits into from
Apr 26, 2023
Merged

Component as props objectOf support. #2207

merged 11 commits into from
Apr 26, 2023

Conversation

T4rk1n
Copy link
Contributor

@T4rk1n T4rk1n commented Aug 26, 2022

Resolve #2129

# Conflicts:
#	tests/integration/renderer/test_component_as_prop.py
@T4rk1n T4rk1n marked this pull request as ready for review April 26, 2023 17:27
@T4rk1n T4rk1n changed the title [WIP] Component as props objectOf support. Component as props objectOf support. Apr 26, 2023
Comment on lines 73 to 80
Object.keys(childObj).forEach(key => {
const value = childObj[key];
crawlLayout(
value,
func,
concat(currentPath, childPath.concat([key]))
);
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal, just a little cleaner. Same at line 143

Suggested change
Object.keys(childObj).forEach(key => {
const value = childObj[key];
crawlLayout(
value,
func,
concat(currentPath, childPath.concat([key]))
);
});
for (const key in childObj) {
const value = childObj[key];
crawlLayout(
value,
func,
concat(currentPath, childPath.concat([key]))
);
}

Comment on lines 133 to 139
dynamic_dict={"node": {"dict-dyn": Div("dict-dyn", id="inside-dict")}},
dynamic_list=[
{"list": Div("dynamic-list", id="inside-list")},
],
dynamic_nested_list=[
{"obj": {"nested": Div("nested", id="nested-dyn")}}
],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty low risk, but if you wanted to cover all bases these props should get two keys & two list items to ensure we're properly looping over everything.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃 Just had a few minor comments, looks great!

@T4rk1n T4rk1n merged commit e145b40 into dev Apr 26, 2023
@T4rk1n T4rk1n deleted the cap-object-of branch April 26, 2023 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Render arbitrary keys of components inside dictionaries.
2 participants