[Solved] I want to use Hooks here but don’t know how . This is my code

React hooks can’t be used outside of functional components. Here, you have a class components (also can’t use hooks) Register. You need convert it into functional component and append your state hooks into it. Also, you can useCallback for momize function. export const Register = (props) => { const [usernameReg, setUsernameReg] = useState(“”); const [passwordReg, … Read more

[Solved] card view shadow effect only top side react native [closed]

install this librery npm i react-native-drop-shadow import this line import DropShadow from “react-native-drop-shadow”; use this view ginv to shasow <DropShadow style={{ shadowColor: “#000”, shadowOffset: { width: 0, height: 0, }, shadowOpacity: 1, shadowRadius: 5, }} > —– Your Contain ————– </DropShadow> solved card view shadow effect only top side react native [closed]

[Solved] I want to make a circle with buttons in react native

Final result: Here is how you can do it: import * as React from ‘react’; import { Text, View, StyleSheet, TouchableOpacity } from ‘react-native’; import Constants from ‘expo-constants’; // You can import from local files import AssetExample from ‘./components/AssetExample’; // or any pure javascript modules available in npm import { Card } from ‘react-native-paper’; export … Read more

[Solved] Focus issues with react

You are not using createRef and trying to use focus method which is the issue. Simply create callback ref and you are good to go. Here is the working code below and codesandbox link. index.js import React from “react”; import ReactDOM from “react-dom”; import FocusComp from “./FocusComp”; class App extends React.Component { state = { … Read more

[Solved] What is the problem with my code that makes it repeat 5 times

Remove obj(keys) (it creates an unnecessary additional loop) and instead just simply map over this.state.value. Then use a unique property for the key (ideally this should be an id that was assigned by your database). import React, { Component } from “react”; class App extends Component { state = { value: [{ id: “b5dc-58f6-u3ga-fbb4”, title: … Read more

[Solved] How to compare each object in an array with each other. When found update the object with a new property

You can use newCollection or manipulate in the collection like this collection.forEach((item)=>{ item.rowMatch = (collection.filter((e)=>{return (e.name==item.name&&e.phone==item.phone)}).length>1)?’true’:’false’; }) console.log(collection) Simple is that.Here is working JSFiddle for it https://jsfiddle.net/touqeer/pgdsw9Le/1/ . 11 solved How to compare each object in an array with each other. When found update the object with a new property

[Solved] Async Functions

The reason your code doesn’t work is that you never call the async function you’ve created. However, there isn’t any reason to make an inner async function; just make the one you already have async: export const setSearchField = text => async (dispatch) => { dispatch({ type: REQUEST_GIFS_PENDING }); try { const response = await … Read more

[Solved] How to design a React component similar to WHO Coronavirus Disease (COVID-19) Dashboard? [closed]

First of all, you will need a Chart library like https://d3js.org/ to be enable to plot the graphs. I found D3js to be the most flexible amongst all the libraries. Then you can integrate the data from your database to the plotting methods provided with the library Examples of D3js plots: https://observablehq.com/@d3/bubble-map https://observablehq.com/@d3/spike-map Other Plotting … Read more

[Solved] I need of help in found one solution on problem, React,Firebase,For Loop [closed]

You should use the callback in setState if you want to do that because it is async. Please refer to the following link to get more info: https://reactjs.org/docs/react-component.html#setstate Another alternative is to set the state only once instead of doing it multiple times. You don’t need to put all that info in the state only … Read more