Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"format": "prettier --write \"{,!(node_modules)/**/}*.js\""
},
"eslintConfig": {
"extends": "@inc4/react"
Expand Down
1 change: 1 addition & 0 deletions src/config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const ENABLE_DEBUG_LOG = true;
3 changes: 3 additions & 0 deletions src/hooks/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { useDebugLog } from './useDebugLog';

export { useDebugLog };
4 changes: 4 additions & 0 deletions src/hooks/useDebugLog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { ENABLE_DEBUG_LOG } from '../config';

export const useDebugLog = (...logs) =>
ENABLE_DEBUG_LOG && console.log(...logs);
7 changes: 6 additions & 1 deletion src/pages/Home/Home.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import React from 'react';
const Home = () => <h1>Home</h1>;
import { useDebugLog } from '../../hooks';
const Home = () => {
useDebugLog('dsdasdas');

return <h1>Home</h1>;
};

export default Home;