Language: TypeScript
Label: vulnerable
CWE: CWE-269 \u2014 Improper Privilege Management
The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.

Code:
    const clearEvent = () => {
        dispatch({ type: "event/dismiss" });
        dispatch({ type: "notification/dismiss" });
        setInputError({});
        setValueChangedOnce(true);
    };