Git Product home page Git Product logo

crud-using-rest-api's Introduction

Getting Started with Create React App And Its Dependencies.

React

  1. react - because this is a React-based template
  2. react-dom - for adding React app to the DOM
  3. react-router - for creating routes to views
  4. history - peer dependency of react-router

Webpack

  1. webpack - for packaging
  2. webpack-dev-server - for development

Loaders

  1. babel-loader - for loading React/jsx components
  2. babel-core - peer dependency for babel-loader
  3. babel-preset-react - to properly load React components
  4. file-loader - for loading images etc.
  5. style-loader - for loading styles
  6. css-loader - for loading css
  7. sass-loader - for loading sass

Plugins

  1. copy-webpack-plugin - to copy static boilerplate to build
  2. Testing
  3. jest-cli - for running tests

Linting

  1. eslint - for linting
  2. eslint-plugin-react - to handle linting amidst jsx

Testing

  1. React Testing Library : npm install --save-dev @testing-library/react
  2. Jest.
  3. Enzyme.

Re-Render :

When a component that is already displayed is re-render again. Purpose is to keep the UI in sync with the states

Error :

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory Solution :-

  1. See the current value of max-old-space-size (in MB) To see the current (not exact but very close) value of max-old-space-size (in MB), run in your terminal : node -e 'console.log(v8.getHeapStatistics().heap_size_limit/(1024*1024))'

  2. Put this is in terminal :
    a. Set NODE_OPTIONS="--max-old-space-size=8192" OR b $env:NODE_OPTIONS="--max-old-space-size=8192"

Best Practices React

  1. prop-types Using 'prop-types' to document and validate the types of props passed to a component helps prevent errors. Prop types help to ensure that the correct data types are being passed into your components, reducing the likelihood of runtime errors. Prop types serve as documentation for your components, making it clear what types of data each component expects and what the component does with that data. They can help to identify issues with your code by providing helpful error messages when an incorrect data type is passed to a component.

Using prop types can help to facilitate collaboration between developers by making it clear what data is expected by each component and reducing confusion about how to use the component. Using prop types can improve the overall quality of your code by reducing the likelihood of runtime errors and making it more maintainable and readable.

Error In Webpack

Module not found: Error: Can't resolve './App' in '/home/user/Desktop/WebDev/React/temp/merntemplate/src' Did you mean 'App.js'? BREAKING CHANGE: The request './App' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.

Solution : In webPack Rules write this. { test: /.m?js/, resolve: { fullySpecified: false, }, }

crud-using-rest-api's People

Contributors

chandan9898kumar avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.