-
Notifications
You must be signed in to change notification settings - Fork 787
Disregard falsy elements when walking tree #1495
Conversation
@bostrom: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
Thanks @bostrom |
@rosskevin any idea when the next |
@omniroot We don't have a timeline yet, but if you are up for using We will be discussing strategy for the next release on Friday 1/5/18 with the committers. |
@omniroot as a workaround, you can filter the array:
|
@rosskevin any idea what the plan is for the next release? |
@omniroot we are discussing on a call tomorrow, call was moved from Friday. |
@rosskevin any updates? |
This PR fixes a problem with server side rendering when rendering an array and one or more of the items in the array is falsy (but other than
null
). This would throw ancannot read property type of null
error.An example case when this can happen is when you do a inline conditional render:
React handles this case gracefully by disregarding falsy values, not rendering them. I would like to assume that Apollo would do the same, but that's not the case, currently it only checks if an element is
null
.This PR replaces the
element == null
with!element
, effectively disregarding all falsy values altogether, more closely mimicking the behaviour of React.