@olea-bps/context-event 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -133,7 +133,11 @@ export default function EventContextProvider({ children }) {
|
|
|
133
133
|
* @returns {object} Eventkontext
|
|
134
134
|
*/
|
|
135
135
|
export function useEventContext() {
|
|
136
|
-
|
|
136
|
+
const context = useContext(EventContext);
|
|
137
|
+
if (context === null) {
|
|
138
|
+
throw new Error('useEventContext must be used within an EventContextProvider');
|
|
139
|
+
}
|
|
140
|
+
return context;
|
|
137
141
|
}
|
|
138
142
|
|
|
139
143
|
/**
|