You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can probably temporarily fix this with toClass() from recompose, though I'd argue that instance methods on components are sort of a React anti-pattern. I think it would probably be better to pass an isValid prop to the custom widgets. This change would ideally be done in a backwards-compatible way as to not bump the major version.
The text was updated successfully, but these errors were encountered:
A quick fix could be something along the lines of what glamorous does as well: allow custom widgets to accept an innerRef prop (or similar) to allow a ref to pass down through to the wrapped component. There might also be something we can do with the newer React.forwardRef API.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
When a custom widget with an
isValid
method is wrapped in a HOC, the following error is thrown when attemping to publish:It looks like
wrappedControlValid
is never set because my HOC is a stateless component, meaning it cannot be ref'd. The function which setswrappedControlValid
returns immediately if a ref is not possible: https://github.com/netlify/netlify-cms/blob/a5d4fd41a4a1f681b117bf6f40ce1263382680a9/src/components/Editor/EditorControlPane/Widget.js#L56-L67I can probably temporarily fix this with
toClass()
from recompose, though I'd argue that instance methods on components are sort of a React anti-pattern. I think it would probably be better to pass anisValid
prop to the custom widgets. This change would ideally be done in a backwards-compatible way as to not bump the major version.The text was updated successfully, but these errors were encountered: