Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Modal): Fix wrong types on ModalProps #5894

Merged
merged 6 commits into from
Jul 13, 2021
Merged

fix(Modal): Fix wrong types on ModalProps #5894

merged 6 commits into from
Jul 13, 2021

Conversation

golota60
Copy link
Collaborator

Resolves: #5732

@golota60 golota60 requested review from jquense and kyletsang and removed request for jquense and kyletsang June 27, 2021 21:59
@golota60 golota60 marked this pull request as draft June 27, 2021 22:03
@golota60
Copy link
Collaborator Author

golota60 commented Jul 3, 2021

Sorry for waiting such a long time on this, had a busy week.

Anyways, this change probably picked up(and allowed me to fix) a bug where onExited wasn't passing a node(see screenshot)
image

I've removed passing of ...args in handleEnter, handleExit, handleExiting,handleExited - I've checked and it doesn't break anything, and I'm pretty sure they weren't supposed to be there in the first place(I've traced the code and there is always only one node argument passed).

I've tried to trace a reason as to why/when ..args were added(and if they're passed for a reason) and found #3187 , which leads me to believe they are not supposed to be there

@golota60 golota60 marked this pull request as ready for review July 3, 2021 20:31
@kyletsang
Copy link
Member

Sorry for waiting such a long time on this, had a busy week.

Anyways, this change probably picked up(and allowed me to fix) a bug where onExited wasn't passing a node(see screenshot)

I've removed passing of ...args in handleEnter, handleExit, handleExiting,handleExited - I've checked and it doesn't break anything, and I'm pretty sure they weren't supposed to be there in the first place(I've traced the code and there is always only one node argument passed).

I've tried to trace a reason as to why/when ..args were added(and if they're passed for a reason) and found #3187 , which leads me to believe they are not supposed to be there

Nice catch on the missing node arg in onExited.

We should keep the args, because all the "enter" callbacks do have an additional isAppearing arg in them: (http://reactcommunity.org/react-transition-group/transition/#Transition-prop-onEnter). There's still an issue in the TransitionCallbacks type in helpers.ts though, because it only specify a node arg.

@golota60
Copy link
Collaborator Author

golota60 commented Jul 4, 2021

Thanks for looking into this!

It seems like ...args should be only in handleEnter, cause according to http://reactcommunity.org/react-transition-group/transition/#Transition-prop-onExit, onExit,onExiting and onExited are passing only node.

Commited the change, but it still needs react-bootstrap/react-overlays#962.

@kyletsang
Copy link
Member

Thanks for looking into this!

It seems like ...args should be only in handleEnter, cause according to http://reactcommunity.org/react-transition-group/transition/#Transition-prop-onExit, onExit,onExiting and onExited are passing only node.

Commited the change, but it still needs react-bootstrap/react-overlays#962.

handleEntering needs it as well. Hmm seems like CI is failing, but shouldn't be related to your changes...

@golota60
Copy link
Collaborator Author

golota60 commented Jul 10, 2021

@kyletsang I wasn't able to pin down why ...args wasn't working(TS just gave me A spread argument must either have a tuple type or be passed to a rest parameter. which wasnt really helpful). But since we only will ever pass isAppearing, I just decided to replace ...args with it.

But in order for this to pass CI, we need react-bootstrap/react-overlays#962 to be merged & released.

@kyletsang
Copy link
Member

@golota60, sorry missed that PR. It's merged and released in 5.1.1 now

@golota60
Copy link
Collaborator Author

@kyletsang everything should be ready to merge 😄

@kyletsang kyletsang merged commit 1db1f11 into react-bootstrap:master Jul 13, 2021
@kyletsang
Copy link
Member

Thanks!

@kyletsang kyletsang added this to To do in 1.x backport Jul 13, 2021
kyletsang pushed a commit that referenced this pull request Sep 6, 2021
* fix(Modal): Fix wrong types on ModalProps

* remove seemingly unnecessary passing of args

* re-added ...args in handleEnter

* re-added args to handleEntering

* replaced args spread operator with isAppearing

* update package lock
# Conflicts:
#	src/Modal.tsx
kyletsang added a commit that referenced this pull request Sep 6, 2021
* fix(Modal): fix wrong types on ModalProps (#5894)

* fix(Modal): Fix wrong types on ModalProps

* remove seemingly unnecessary passing of args

* re-added ...args in handleEnter

* re-added args to handleEntering

* replaced args spread operator with isAppearing

* update package lock
# Conflicts:
#	src/Modal.tsx

* fix merge

Co-authored-by: Szymon Wiszczuk <37072867+golota60@users.noreply.github.com>
@kyletsang kyletsang moved this from To do to Done in 1.x backport Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

missing backdrop attribute on ModalProps when using typescript
2 participants