Fixing incorrect documentation tags#10530
Conversation
| * @param {rootNodeID} rootNodeID React root node ID that event occurred on. | ||
| * @param {TopLevelType} topLevelType Top level type of event. | ||
| * @param {object} nativeEventParam Object passed from native. | ||
| * @param {?object} nativeEventParam Object passed from native. |
There was a problem hiding this comment.
Just wondering - how do we know that this third param is optional? Seems like it always gets passed in.
There was a problem hiding this comment.
Hi Flarnie,
This one I could be wrong about it, I assumed it could be nullable due to the bellow line
var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT;There was a problem hiding this comment.
That check does imply that - thinking we could update the Flow type here too in that case. Could be a follow-up PR.
|
In the future I’d prefer that we remove jsdocs for arguments. Types are often wrong or outdated (since, unlike Flow, they’re not checked), and names should be descriptive anyway. |
|
@gaearon We need to chat, the reason I managed to find all this documentations miss places is because I been working on a solution that solves exactly that matter that you described. |
Minor nits, fixing the documentation tags params based on the flow type annotation