Skip to content

Commit 80a643f

Browse files
committed
Add backgroundColor example use case
1 parent 1a26207 commit 80a643f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

packages/rn-tester/js/examples/Switch/SwitchExample.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,23 @@ class OnChangeExample extends React.Component<{...}, $FlowFixMeState> {
244244
}
245245
}
246246

247+
class ContainerBackgroundColorStyleExample extends React.Component<
248+
{...},
249+
$FlowFixMeState,
250+
> {
251+
render() {
252+
return (
253+
<View>
254+
<Switch
255+
style={{backgroundColor: 'blue'}}
256+
thumbColor="white"
257+
value={true}
258+
/>
259+
</View>
260+
);
261+
}
262+
}
263+
247264
exports.title = 'Switch';
248265
exports.documentationURL = 'https://reactnative.dev/docs/switch';
249266
exports.category = 'UI';
@@ -291,6 +308,12 @@ exports.examples = [
291308
return <OnChangeExample />;
292309
},
293310
},
311+
{
312+
title: "The container's background color can be set",
313+
render(): React.Element<any> {
314+
return <ContainerBackgroundColorStyleExample />;
315+
},
316+
},
294317
];
295318

296319
if (Platform.OS === 'ios') {

0 commit comments

Comments
 (0)