Currently, src/Alerts/MessageContext.ts exports a number of the base components needed to assemble a working message reducer in a consuming application. However, the barrel file in src/Alerts/index.ts is only exporting default, so the MessageContext itself is the only component that can be directly import into another app from mark-one. This results in us needing to do the following:
import { GlobalMessage } from 'mark-one';
import { MessageReducerAction, messageReducer } from 'mark-one/lib/Alerts/MessageContext';
As an immediate fix, we can update the index.ts to export everything from MessageContext.
As a longer term approach, we may want to define some kind of MessageWrapper that would bundle together more of the functionality into a single component that we can import along with a useDispatchMessage hook.
Currently,
src/Alerts/MessageContext.ts
exports a number of the base components needed to assemble a working message reducer in a consuming application. However, the barrel file insrc/Alerts/index.ts
is only exportingdefault
, so theMessageContext
itself is the only component that can be directly import into another app frommark-one
. This results in us needing to do the following:As an immediate fix, we can update the
index.ts
to export everything fromMessageContext
.As a longer term approach, we may want to define some kind of
MessageWrapper
that would bundle together more of the functionality into a single component that we can import along with auseDispatchMessage
hook.