Skip to main content

Posts

Showing posts from August, 2021

react-scripts start

 npm start > reactjquery@0.1.0 start F:\my pro\dt\reactjquery > react-scripts start There might be a problem with the project dependency tree. It is likely not a bug in Create React App, but something you need to fix locally. The react-scripts package provided by Create React App requires a dependency:   "webpack": "4.44.2" Don't try to install it manually: your package manager does it automatically. However, a different version of webpack was detected higher up in the tree:   F:\my pro\dt\reactjquery\node_modules\webpack (version: 5.47.1) Manually installing incompatible versions is known to cause hard-to-debug issues. If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project. That will permanently disable this message but you might encounter other issues. To fix the dependency tree, try following the steps below in the exact order:   1. Delete package-lock.json (not package.json!) and/or yarn.lock in your pro...

GraphQL vs REST

  GraphQL   GraphQL is an application layer server-side technology which is developed by Facebook for executing queries with existing data. GraphQL can optimize RESTful API calls. It gives a declarative way of fetching and updating your data. GraphQL helps you to load data from server to client. It enables programmers to choose the types of requests they want to make. REST REST is a software architectural style that defines a set of constraints for creating web services. It is designed specifically for working with media components, files, or hardware device. The full form of REST is Representational State Transfer. ========================================================= Here is the important difference between GraphQL and REST. GraphQL REST GraphQL is an application layer server-side technology which is developed by Facebook for executing queries with existing data. REST is a software architectural style that defines a set of constraints for creating Web services. It follow...

vuejs setup error - ExecutionPolicy Unrestricted

npm\vue.ps1  cannot be loaded because running scripts is disabled on    this system. For more information, see  about_Execution_Policies at  https:/go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:1 + ~~~     + CategoryInfo          : SecurityError: (:) [], PSS      ecurityException     + FullyQualifiedErrorId : UnauthorizedAccess soluion:   Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted

AXIOS : with JavaScript or TypeScript?

AXIOS : Promise based HTTP client for the browser and node.js  Axios is a   promise-based   HTTP Client for   node.js   and the browser. It is   isomorphic   (= it can run in the browser and nodejs with the same codebase). On the server-side it uses the native node.js   http   module, while on the client (browser) it uses XMLHttpRequests. or simply  Axios is a tool that can help simplify retrieving data when making API calls to a backend service.   Features Make  XMLHttpRequests  from the browser Make  http  requests from node.js Supports the  Promise  API Intercept request and response Transform request and response data Cancel requests Automatic transforms for JSON data Client side support for protecting against  XSRF Reason to use Axios with TypeScript: Because browser doesn't recognize the commonjs output, and failed to find the axios source code. Typescript only compile the ts code into js, bu...

AMD Ryzen 5 4600H vs AMD Ryzen 7 4800H

 AMD Ryzen 5 4600H vs AMD Ryzen 7 4800H ASUS TUF Gaming A17 Ryzen 5 Hexa Core 4600H  vs  Lenovo IdeaPad Gaming 3 Ryzen 7 Octa Core 4800H consider these two websites for detail: need to check RAM performance as well UserBenchmark: AMD Ryzen 5 4600H vs 7 4800H AMD Ryzen 5 4600H vs AMD Ryzen 7 4800H: What is the difference? (versus.com)

React Lifecycle methods and their purposes

React Lifecycle methods: constructor() getDerivedStateFromProps() render() componentDidMount()   A component is updated whenever there is a change in the component's   state   or   props . React has five built-in methods that gets called, in this order, when a component is updated: getDerivedStateFromProps() shouldComponentUpdate() render() getSnapshotBeforeUpdate() componentDidUpdate() In the  getSnapshotBeforeUpdate()  method you have access to the  props  and  state   before  the update, meaning that even after the update, you can check what the values were  before  the update. If the  getSnapshotBeforeUpdate()  method is present, you should also include the  componentDidUpdate()  method, otherwise you will get an error. the most reason for writing a method as a class property is when  the method will be passed as a callback, and you need it to always be bound to the instance . React lifecycle m...