Functional components can't be specced
lilactown opened this issue · comments
Will Acton commented
Because functional components are expected to take in a JavaScript object as props, and return a React Element, it is not currently possible to write a spec for them.
Will Acton commented
c5fccda adds support for pre- and post-conditions in the defnc
macro.
I think that this adequately satisfies most uses of speccing React components.
One enhancement might be to enable/disable pre/post checks based on goog.DEBUG.