Posts

Showing posts from July, 2022

react Searching

//imp: javascript - A component is changing an uncontrolled input of type text to be controlled error in ReactJS - Stack Overflow   import   React ,{ useState , useEffect }  from   'react' import   axios   from   'axios' ; export   default   function   Search () {      const  [ id , setId ]= useState ();      const  [ data , setData ]= useState ({}); //update       useEffect (()  =>  {          const   loadData  =  async  ()  =>  {              try  {                              let   res  =  await   axios . get ( `https://jsonplaceholder.typicode.com/posts/...

angular js[error]

 https://stackoverflow.com/questions/46408537/angular-httpclient-http-failure-during-parsing [post data]

javascriptclearInterval

  function   f1 (){   count = 20 ;      setInterval (          function (){              document . getElementById ( 'c' ). innerText = count ;                           if ( count > 0 ){                  count --;             }              else {                  document . getElementById ( 'a' ). innerHTML = `<h1>                 End Sale</h1>` ;   ...

crud react

import {useHistory} from 'react-redirect-dom' let history=useHistory();  const onsubmit=async()=>{ e.preventDefault(); await Axios.post('url',state); //for redirect history.push('/');//redirect page like /about /contact  etc..... } /................................................................................................................/ Just make sure that you've added  to  props to  <Link>  otherwise you would also get the same error. after adding it should look something like this:- < Link to= "#" > /.............................................../ useparams:0---

mongodb1

1 mongodb is no sql datatabase 2.no sql meaning it does not store the data on row and column it stores the storage format is bson which is binary style of json. document:data[field:value]...[row:[column]] collection:table database https://www.mongodb.com/docs/v5.0/ And condiition in mongodb :-- db.record.find({name:"anmol",rollno:1}) Less then condition in mongodb:-- db.record.find({rollno:{$lt:2}})  db.record.find({rollno:{$lte:2}}) //less then equal to db.record.find({rollno:{$gt:1}})// greater then And Operatort in mongodb:-- db.collectionname({$and:[{},{}]}) db.record.find({$and:[{rollno:2},{address:"delhi"}]}) or operator db.record.find({$or:[{rollno:2},{address:"delhi"}]})

react native

Network Response Time Out Error (create-react-native-app) (expo) - Stack Overflow i have created the project in expo video recomended: (1037) Install Android Emulator for React Native Expo - Windows PC - YouTube  https://dev.to/shivams136/create-react-native-app-for-android-ios-and-web-without-expo-48lc error:-type annotations can only be used in typescript files.ts(8010) solution:-- https://stackoverflow.com/questions/48859169/error-types-can-only-be-used-in-a-ts-file-visual-studio-code-using-ts-che settings.json:-- "javascript.validate.enable" :  false