-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Components: Ensure that SlotFill does not use portals in React Native (…
- Loading branch information
Showing
7 changed files
with
223 additions
and
176 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { omit } from 'lodash'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import BaseSlot from './slot'; | ||
import Fill from './fill'; | ||
import Provider from './provider'; | ||
|
||
export { Fill, Provider }; | ||
|
||
export function Slot( props ) { | ||
return <BaseSlot { ...omit( props, 'bubblesVirtually' ) } />; | ||
} | ||
|
||
export function createSlotFill( name ) { | ||
const FillComponent = ( props ) => <Fill name={ name } { ...props } />; | ||
FillComponent.displayName = name + 'Fill'; | ||
|
||
const SlotComponent = ( props ) => <Slot name={ name } { ...props } />; | ||
SlotComponent.displayName = name + 'Slot'; | ||
|
||
return { | ||
Fill: FillComponent, | ||
Slot: SlotComponent, | ||
}; | ||
} |
Oops, something went wrong.