Reach-ui: @reach/alert-dialog: expects a function but forwardRef returns an object?

Created on 25 Jun 2019  路  5Comments  路  Source: reach/reach-ui

@reach/alert-dialog expects prop ref to be a function, but React's forwardRef returns an object. Am I doing something wrong with forwarding the ref or should @reach/alert-dialog also accept an object?

This is the error I'm getting:

Warning: Failed prop type: Invalid prop `leastDestructiveRef` of type `object` supplied to `AlertDialog`, expected `function`.

CodeSandbox: https://codesandbox.io/s/youthful-euclid-o9e4b

Unconfirmed

Most helpful comment

@CClerville, we fixed the proptype check but haven't cut a new release yet. @mjackson will be doing that tomorrow or Wednesday so after our next update the warning should go away.

All 5 comments

updated https://codesandbox.io/s/condescending-stonebraker-fwlum

Same warning, but other problem.

Fixed in https://github.com/reach/reach-ui/pull/301/files#diff-c97e9a808b154016bfaa2e9d32d1cbf6R108

This error still occurs...

@CClerville, we fixed the proptype check but haven't cut a new release yet. @mjackson will be doing that tomorrow or Wednesday so after our next update the warning should go away.

@chancestrickland awesome! perfect timing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gdsrosa picture gdsrosa  路  3Comments

higimo picture higimo  路  3Comments

loicplaire picture loicplaire  路  3Comments

denkristoffer picture denkristoffer  路  5Comments

kylemh picture kylemh  路  3Comments