Skip to content

Commit

Permalink
[react-ui] Remove event object warnings (#16822)
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm authored Sep 19, 2019
1 parent a5df18a commit 924a305
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
10 changes: 0 additions & 10 deletions packages/react-dom/src/events/DOMEventResponderSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,6 @@ function validateEventValue(eventValue: any): void {
);
}
};
eventValue.preventDefault = () => {
if (__DEV__) {
showWarning('preventDefault()');
}
};
eventValue.stopPropagation = () => {
if (__DEV__) {
showWarning('stopPropagation()');
}
};
eventValue.isDefaultPrevented = () => {
if (__DEV__) {
showWarning('isDefaultPrevented()');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -837,30 +837,6 @@ describe('DOMEventResponderSystem', () => {
</button>
);
};
expect(() => {
handler = event => {
event.preventDefault();
};
ReactDOM.render(<Test />, container);
dispatchClickEvent(buttonRef.current);
}).toWarnDev(
'Warning: preventDefault() is not available on event objects created from event responder modules ' +
'(React Flare).' +
' Try wrapping in a conditional, i.e. `if (event.type !== "press") { event.preventDefault() }`',
{withoutStack: true},
);
expect(() => {
handler = event => {
event.stopPropagation();
};
ReactDOM.render(<Test />, container);
dispatchClickEvent(buttonRef.current);
}).toWarnDev(
'Warning: stopPropagation() is not available on event objects created from event responder modules ' +
'(React Flare).' +
' Try wrapping in a conditional, i.e. `if (event.type !== "press") { event.stopPropagation() }`',
{withoutStack: true},
);
expect(() => {
handler = event => {
event.isDefaultPrevented();
Expand Down

0 comments on commit 924a305

Please sign in to comment.