bp365.apps.spfx.uploader
v0.1.0
Published
1. 프로젝트 생성 npx create-react-app bp365.apps.spfx.uploader --template typescript
Readme
프로젝트 생성과정
프로젝트 생성 npx create-react-app bp365.apps.spfx.uploader --template typescript
React 17로 다운그레이드(SPFX는 react 17까지 지원) npm uninstall react react-dom @types/react @types/react-dom npm install [email protected] [email protected] npm install -D @types/[email protected] @types/[email protected]
testing-library 계열 17호환 버전으로 버전변경
@testing-library/react를 12.x 대로 낮추는 게 핵심.(16.x는 React 18/19 요구) "dependencies": { "@testing-library/react": "^12.1.5",
"@testing-library/jest-dom": "^5.16.5", "@testing-library/user-event": "^13.5.0", "@testing-library/dom": "^10.4.1, ==> 이 패키지는 React 17/18 버전과 무관하게 그냥 DOM API 위에서 동작하기 때문에, 굳이 변경 불필요 "react": "17.0.1", "react-dom": "17.0.1", "react-scripts": "5.0.1", "web-vitals": "^2.1.4" }, "devDependencies": { "@types/react": "17.0.53", "@types/react-dom": "17.0.19", "typescript": "^4.9.5" }모듈 재설치 Remove-Item -Recurse -Force node_modules // node_modules 삭제 Remove-Item -Force package-lock.json //package-lock.json 삭제 npm install // 전체 모듈 재설치
랜더링 방식 변경
import React from "react"; import ReactDOM from "react-dom/client"; import App from "./App";
const root = ReactDOM.createRoot(document.getElementById("root")!); root.render( <React.StrictMode> </React.StrictMode> ) 아래처럼 변경해야 됨
import React from "react"; import ReactDOM from "react-dom"; import App from "./App";
ReactDOM.render( <React.StrictMode> </React.StrictMode>, document.getElementById("root") );
응 그렇게 해줄래부터 다음주 작업 돌입한다.
ROLLUP설치
npm install [email protected] --save-dev npm install @rollup/[email protected] --save-dev npm install @rollup/[email protected] --save-dev npm install @rollup/[email protected] --save-dev npm install [email protected] --save-dev npm install [email protected] --save-dev npm install [email protected] --save-dev npm install [email protected] --save-dev npm install [email protected] --save-dev npm install @rollup/[email protected] --save-dev
Getting Started with Create React App
This project was bootstrapped with Create React App.
Available Scripts
In the project directory, you can run:
npm start
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
npm test
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
npm run build
Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
npm run eject
Note: this is a one-way operation. Once you eject, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
Learn More
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
