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

Replace defaultProps with default js parameters #932

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 12 additions & 19 deletions packages/react-native-external-display/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,30 @@

type Props = {
...ViewProps,
style?: ViewProps.style,

Check failure on line 25 in packages/react-native-external-display/index.js

View workflow job for this annotation

GitHub Actions / lint

propType "style" is not required, but has no corresponding defaultProps declaration
mainScreenStyle?: ViewProps.style,

Check failure on line 26 in packages/react-native-external-display/index.js

View workflow job for this annotation

GitHub Actions / lint

propType "mainScreenStyle" is not required, but has no corresponding defaultProps declaration
screen?: string,

Check failure on line 27 in packages/react-native-external-display/index.js

View workflow job for this annotation

GitHub Actions / lint

propType "screen" is not required, but has no corresponding defaultProps declaration
fallbackInMainScreen?: boolean,

Check failure on line 28 in packages/react-native-external-display/index.js

View workflow job for this annotation

GitHub Actions / lint

propType "fallbackInMainScreen" is not required, but has no corresponding defaultProps declaration
onScreenConnect?: Function,

Check failure on line 29 in packages/react-native-external-display/index.js

View workflow job for this annotation

GitHub Actions / lint

propType "onScreenConnect" is not required, but has no corresponding defaultProps declaration
onScreenChange?: Function,

Check failure on line 30 in packages/react-native-external-display/index.js

View workflow job for this annotation

GitHub Actions / lint

propType "onScreenChange" is not required, but has no corresponding defaultProps declaration
onScreenDisconnect?: Function,

Check failure on line 31 in packages/react-native-external-display/index.js

View workflow job for this annotation

GitHub Actions / lint

propType "onScreenDisconnect" is not required, but has no corresponding defaultProps declaration
}

const ExternalDisplayView = (props: Props) => {
const {
screen,
fallbackInMainScreen,
mainScreenStyle,
style,
const ExternalDisplayView = ({
style = undefined,
mainScreenStyle = undefined,
screen = '',
fallbackInMainScreen = false,
onScreenConnect = () => {},
onScreenChange = () => {},
onScreenDisconnect = () => {},
...nativeProps
}: Props) => {
const screens = useExternalDisplay({
onScreenConnect,
onScreenChange,
onScreenDisconnect,
...nativeProps
} = props
const screens = useExternalDisplay(props)
})
const scr = screens[screen]
if (!scr && !fallbackInMainScreen) {
return null
Expand All @@ -68,16 +71,6 @@
)
}

ExternalDisplayView.defaultProps = {
style: undefined,
mainScreenStyle: undefined,
screen: '',
fallbackInMainScreen: false,
onScreenConnect: () => {},
onScreenChange: () => {},
onScreenDisconnect: () => {},
}

export { getScreens, useExternalDisplay, SceneManager }

export default ExternalDisplayView
Loading