diff --git a/src/React.purs b/src/React.purs index d2485f8..ff7b217 100644 --- a/src/React.purs +++ b/src/React.purs @@ -93,6 +93,8 @@ foreign import data ReactComponent :: Type -- | A reference to a component, essentially React's `this`. foreign import data ReactThis :: Type -> Type -> Type +type role ReactThis representational representational + foreign import data ReactUnusedSnapshot :: Type type SyntheticEventHandler event = EffectFn1 event Unit @@ -251,6 +253,8 @@ foreign import statelessComponent :: forall props. -- | React class for components. foreign import data ReactClass :: Type -> Type +type role ReactClass representational + foreign import fragment :: ReactClass { children :: Children } -- | Read the component props. diff --git a/src/React/Ref.purs b/src/React/Ref.purs index 8d05a16..a8a57ef 100644 --- a/src/React/Ref.purs +++ b/src/React/Ref.purs @@ -27,8 +27,12 @@ foreign import data NativeNode :: Type foreign import data Ref :: Type -> Type +type role Ref representational + foreign import data RefHandler :: Type -> Type +type role RefHandler representational + foreign import createRef :: forall a. Effect (Ref a) diff --git a/src/React/SyntheticEvent.purs b/src/React/SyntheticEvent.purs index 6d82634..25592a6 100644 --- a/src/React/SyntheticEvent.purs +++ b/src/React/SyntheticEvent.purs @@ -136,6 +136,8 @@ type SyntheticWheelEvent foreign import data SyntheticEvent_ :: Row Type -> Type +type role SyntheticEvent_ representational + foreign import data NativeEventTarget :: Type foreign import data NativeEvent :: Type