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

Smarter Monoid instance for ReactElement #157

Closed
natefaubion opened this issue Sep 25, 2018 · 4 comments
Closed

Smarter Monoid instance for ReactElement #157

natefaubion opened this issue Sep 25, 2018 · 4 comments

Comments

@natefaubion
Copy link
Contributor

React still sometimes has trouble with [] as mempty if you are returning it from a render method. We should use null as mempty. Additionally, we should make a smarter append that does not build nested fragments, but instead concatenates Arrays.

@thomashoneyman thomashoneyman added the purs-0.14 A reminder to address this issue or merge this PR before we release PureScript v0.14.0 label Dec 9, 2020
@thomashoneyman
Copy link
Contributor

I think we should try and get this in for the upcoming breaking release for PureScript 0.14.

@thomashoneyman
Copy link
Contributor

We may not be able to get this in for 0.14 due to a backlog of other work, so I'm going to remove the label.

@thomashoneyman thomashoneyman removed the purs-0.14 A reminder to address this issue or merge this PR before we release PureScript v0.14.0 label Dec 26, 2020
@JordanMartinez
Copy link
Contributor

Fixed by #187

@natefaubion
Copy link
Contributor Author

natefaubion commented Jan 5, 2023

To be clear, I only changed it so that mempty is null and it avoids creating redundant fragments if one of the elements is also null. There isn't a reliable way of always flattening to an Array in append, and it may not even be desirable. I think the most reliable way if it's something you want is to use reacts Children.toArray API to flatten at the end.

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

No branches or pull requests

3 participants