mirror of
https://github.com/zhigang1992/react-native-bottom-sheet.git
synced 2026-01-12 17:42:17 +08:00
chore: added no console eslint rule (#199)
This commit is contained in:
@@ -2,6 +2,7 @@ module.exports = {
|
||||
root: true,
|
||||
extends: ['@react-native-community', 'prettier'],
|
||||
rules: {
|
||||
'no-console': ['error', { allow: ['warn', 'error'] }],
|
||||
'prettier/prettier': [
|
||||
'error',
|
||||
{
|
||||
|
||||
@@ -4,7 +4,6 @@ import { enableScreens } from 'react-native-screens';
|
||||
import App from './src/App';
|
||||
import { name as appName } from './app.json';
|
||||
|
||||
console.disableYellowBox = true;
|
||||
enableScreens(true);
|
||||
|
||||
AppRegistry.registerComponent(appName, () => App);
|
||||
|
||||
@@ -21,6 +21,7 @@ const createDummyScreen = ({
|
||||
const { navigate } = useNavigation();
|
||||
|
||||
const handleNavigatePress = useCallback(() => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('navigateTo', nextScreen);
|
||||
navigate(nextScreen);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
||||
@@ -81,6 +81,7 @@ const NavigatorExample = () => {
|
||||
|
||||
// callbacks
|
||||
const handleSheetChange = useCallback(index => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('handleSheetChange', index);
|
||||
}, []);
|
||||
const handleSnapPress = useCallback(index => {
|
||||
|
||||
@@ -10,9 +10,11 @@ const SimpleExample = () => {
|
||||
|
||||
// callbacks
|
||||
const handleChange = useCallback((index: number) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('index', index);
|
||||
}, []);
|
||||
const handleDismiss = useCallback(() => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('on dismiss');
|
||||
}, []);
|
||||
const handleDismissPress = useCallback(() => {
|
||||
|
||||
@@ -33,6 +33,7 @@ const BasicExample = () => {
|
||||
|
||||
// callbacks
|
||||
const handleSheetChanges = useCallback((index: number) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('handleSheetChanges', index);
|
||||
}, []);
|
||||
const handleSnapPress = useCallback(index => {
|
||||
@@ -46,7 +47,6 @@ const BasicExample = () => {
|
||||
}, []);
|
||||
|
||||
// renders
|
||||
console.log('BasicExample', 'render');
|
||||
return (
|
||||
<View style={containerStyle}>
|
||||
<Button
|
||||
|
||||
@@ -44,11 +44,13 @@ const createExampleScreen = ({ type, count = 20 }: ExampleScreenProps) =>
|
||||
|
||||
// callbacks
|
||||
const handleSheetChange = useCallback(index => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('handleSheetChange', index);
|
||||
}, []);
|
||||
|
||||
const handleSheetAnimate = useCallback(
|
||||
(fromIndex: number, toIndex: number) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('handleSheetAnimate', `from ${fromIndex} to ${toIndex}`);
|
||||
},
|
||||
[]
|
||||
|
||||
@@ -551,13 +551,13 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
|
||||
//#endregion
|
||||
|
||||
//#region render
|
||||
console.log(
|
||||
'BottomSheet',
|
||||
'render',
|
||||
snapPoints,
|
||||
sheetHeight,
|
||||
safeHandleHeight
|
||||
);
|
||||
// console.log(
|
||||
// 'BottomSheet',
|
||||
// 'render',
|
||||
// snapPoints,
|
||||
// sheetHeight,
|
||||
// safeHandleHeight
|
||||
// );
|
||||
return (
|
||||
<BottomSheetProvider value={externalContextVariables}>
|
||||
<BottomSheetBackdropContainer
|
||||
|
||||
Reference in New Issue
Block a user