Skip to content

Commit

Permalink
feat: swift와의 연결을 위한 함수 수정
Browse files Browse the repository at this point in the history
feat: swift와의 연결을 위한 함수 수정
  • Loading branch information
urimeee authored Dec 29, 2024
2 parents 428464a + 2d8d84b commit 2a02947
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/custom.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// import { UserInfo } from './types/userInfo';

declare module '*.svg' {
const content: any;
export default content;
Expand All @@ -10,9 +8,6 @@ declare module '*.png' {
export default content;
}

// declare global {
interface Window {
receiveUserInfo?: (userInfo: import('./types/userInfo').UserInfo) => void;
}

// }
5 changes: 2 additions & 3 deletions src/pages/PlusPage/PlusPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ const PlusPage = () => {
const [userInfo, setUserInfo] = useState<UserInfo>({});

useEffect(() => {
console.log(window.receiveUserInfo);
window.receiveUserInfo = (info: UserInfo) => {
window.receiveUserInfo = function (info: UserInfo) {
setUserInfo(info);
console.log(userInfo);
console.log('Received user info : ', info);
};
}, []);

Expand Down

0 comments on commit 2a02947

Please sign in to comment.