-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref: Allow conditional loading in
ReleaseSeries
(#83506)
Adds an `enabled` prop to `ReleaseSeries`. This makes it _much_ easier to conditinally render the component! In a few places in the app we do this kind of shenanigan: ```jsx ... if (needsReleases) { return <ReleaseSeries blah blah <MyComponent } else { return <MyComponent } ``` If `MyComponent` is a big chunk of JSX, this is a lot of very gross duplication. Instead, I'm following the same idea as our data hooks. An `enabled` prop can turn `ReleaseSeries` fetching on and off. Then, `<MyComponent` can check whether it got releases or not. No fuss, no muss.
- Loading branch information
Showing
2 changed files
with
56 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters