New answers tagged reactjs
0
votes
How to get react installed
This happens when we don't add the path of node.js to environment variables. See one video on youtube and add it.
0
votes
Unable to access Rest endpoints even after successful login in spring security through react form
With the custom endpoint, there is one slight detail missing: SecurityContext is not populated during the login request/response. Without storing it, further requests still will be anonymous despite ...
0
votes
woocommerce store api + reactjs - add to cart not working
When working with woocommerce Store Api you need to use "cart-token" now, as woo developers says in comments at github and their blog, you also need consider cors as well. Check article and ...
0
votes
EZGrid React DataGrid showing error "Module not found: Error: Can't resolve 'react/jsx-runtime'"?
I managed to solve the problem by adding the following alias to my webpack config:
resolve: {
alias: {
'react/jsx-runtime': 'react/jsx-runtime.js',
},
}
0
votes
How to get react installed
Try to adjust the policies, let's first open Windows PowerShell with administrative privileges.
Open Windows PowerShell by right-clicking and selecting "Run as Administrator".
Next, execute ...
0
votes
Passing variable from React to CSS - proper formate and usage
You never set a value for --myVar in your document style.
You also cant write stuff like this var(--myVar)px and this var(--myVar - 47)px
The solution would be in the lines of:
React Side
const myVar =...
0
votes
After building ReactTS app some "display: flex" disappears
look after if there, any css file over-riding this code css classes..
1
vote
Accepted
Does @preact/signals-react work with concurrent mode of React 18?
Full disclosure: I'm a maintainer.
They do work with React 18 and all known React features at the moment, though the React team has publicly stated on Twitter they're planning some features in the ...
0
votes
Error in React vite project due to rollup dependency (module not found)
This might be happening because you are mounting your volumes wrong.
If your docker compose file has this in it:
services:
app:
volumes:
- .:/app
You are copying all your local ...
0
votes
Firestore snapshot realtime paging
Unsubscribing listeners is documented here: https://firebase.google.com/docs/firestore/query-data/listen#detach_a_listener. If you're having trouble getting this to work, edit your question to show ...
0
votes
How to prevent scroll-to-top on certain links in React-Router with a custom ScrollToTop component
You can accomplish skipping resetting the scroll-to-top a few different ways:
Convert ScrollToTop to a layout route to wrap only the routes you want to scroll-to-top:
import { Outlet } from 'react-...
0
votes
How to submit data split into multiple children components without unnecessary re-renders
For the third option consider using refs:
export interface A {
a: string
}
export interface B {
b: string
}
export default function Parent() {
const ref1: MutableRefObject<A> = useRef({a:...
0
votes
Passport JS + React application internal 500 errro
fixed the issue on my own, figured out to move the external router below the passport initialization as it is required in the router to authenticate a user.
i appreciate your guy's help very much. ...
0
votes
razorpay order id and razorpay signtaure value is undefined in the payment response
Try to use order_id instead of orderId in the options. Also, check if you correctly generated the order_id value as a string. console.log it before setting it as a value for order_id.
console.log(...
0
votes
Why the error is not displayed when using formik useField?
const [field, meta] = useField({ ...props, name: props.name, id: props.name });
const formik = useFormikContext();
if (formik.submitCount > 0) {
meta.touched = true;
}
0
votes
Set min/max on TextField type="number"?
const minAmount = '0';
const maxAmount = '10000';
export default function BasicTextFields() {
const [amount, setAmount] = useState('');
return (
<>
<Input
type='number'...
0
votes
How to prevent scroll-to-top on certain links in React-Router with a custom ScrollToTop component
React Router works on maintaining the same scroll position if we navigate from one route to another. To prevent those we use custom scroll like you did and use overall on routes in app.
export const ...
0
votes
how to add text annotations to text notes in a react nextjs 14 (app router) app
It could be an error in calculating and keeping track of the text indices and rendering the notes inside the text. Here are a few possible improvements and suggestions to help resolve the issue:
Use ...
-1
votes
Animation | Transition in React JS
You should be able to achieve the effect with css transform by using the keyframes animation which could be defined to scale the calendar element from 1 to 0.5 and change its opacity while the ...
0
votes
How do I make Material UI container have full width and height?
I guess you need to use
<Container maxWidth={false} disableGutters component='main'>
Also inside theme file you should use
MuiContainer: {
styleOverrides: {
disableGutters: {
...
0
votes
How do I configure Vite reverse proxy to test React application?
localhost does not seem to work. I tried replacing localhost with 127.0.0.1 and now it does work.
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default ...
-1
votes
React router not running
React Router is a router. If you navigate to /Products in your browser's URL it should show up.
0
votes
searching for this font animation but couldn't find
this effect use a colour gradient in CSS.
.gradient_effect
{
font-size : 400%;
background : linear-gradient(to right, #666, #666 32%, #F69 32%, #F69);
background-clip : text;
color : ...
0
votes
What are these three dots in React doing?
This technique is helpful for forwarding props from a parent component to a child component without explicitly listing each prop, making the code more concise and easier to manage.
0
votes
Error decoding .mov file on ios and macos - DOMException when processing audio data in React app
Consider using a library like ffmpeg.js to handle the decoding and conversion of audio files directly in the browser. This can bypass some limitations of the Web Audio API.
// Example using ffmpeg.js
...
0
votes
How do I add an external JS and use its function in my component in REACT?
You can use useEffect to Load External Scripts with a callback function
0
votes
What should my vercel.json config file to deploy my MERN stack given my current project folder organization?
Here is how I deployed:
First, do the following:
Install CORS:
npm install cors
Add this code to index.js(Your backend):
app.use(cors({
origin: [""],
methods: ["POST", &...
0
votes
Importing images in TypeScript React - "Cannot find module"
Create a file custom.d.ts inside the src folder and add this lines:
declare module “.jpg” for jpg images
declare module “.jpeg” for jpeg images
declare module “.svg” for svg images
declare module “....
0
votes
How do I conditionally add attributes to React components?
conditional logic:
function MyInput({ isRequired, isReadOnly }) {
return (
<input
className="foo"
{...(isRequired ? { required: true } : {})}
{...(isReadOnly ? { ...
0
votes
Nodemailer contact us form
Ah yes, I know this problem. Using Gmail as your SMTP relay does have this limitation, and it is clearly described in Nodemailer's documentation as:
Gmail also always sets authenticated username as ...
0
votes
Passing data between pages in React Router using the Action and Loaders
My last comment lead me to an answer: submit to the same Page component and use the useActionData hook. Conceptually, it's similar to traditional server-side form submits: the POST request goes back ...
0
votes
'Cannot find module' when using dynamic import
import
Dynamic expressions in import()
https://webpack.js.org/api/module-methods/#dynamic-expressions-in-import
It is not possible to use a fully dynamic import statement, such as import(foo). ...
0
votes
No routes matched location "/login" react router dom v6
Use default export at the end of the component.. maybe you are not exporting your component or using same line export..
0
votes
Clerk + Convex Auth
Do not use useQuery on your page.tsx
Use it in components like @/components/something.tsx
then in page.tsx just return it
"use client";
import Something from "@/components/...
0
votes
Access to fetch at from origin 'http://localhost:3000' has been blocked by CORS policy
I don't know if it will work for you or not but manually adding cors worked for me.
instead of this
const corsOption = {
credentials: true,
origin: ["https://example.com/"],
}
app.use(...
0
votes
react-bootstrap breadcrumb with react-router-dom
import { useNavigate } from 'react-router-dom';
const BreadcrumbComponent = () => {
const navigate = useNavigate();
return (
<Breadcrumb>
<Breadcrumb.Item ...
-1
votes
Is possible to convert HTLM to EditorJS json?
{
"id": "2HhVG2x2UBw",
"uploaddate": "2019-05-02",
"duration": 144,
"title": "~Where's My Hairbrush?~ {Sparta Venom Mix!...
0
votes
Why the form property not working on MUI button as like html button field?
const formRef = useRef(null);
formRef.current.requestSubmit();
submit with requestSubmit works for me.
0
votes
How to reload a component (part of page) in reactjs?
If you'd like to use "hard reload" (remove component and recreate it) instead of forcing child components to just re-render themselves but of course without page reloading, I prepared reload ...
0
votes
How to ignore SSL issues in axios using React Native?
if you are using React Native Cli you can easily bypass ssl for Android by the following method:
Add new file IgnoreSSLFactory.java to the same path of MainApplicaiton.java (/android/app/src/main/java/...
0
votes
Next.js not auto refreshing
Note that npm start helps to start you application and also useful to start you production server.
NPM START run the following script in the backend
npm start
"scripts": {
"start&...
0
votes
Passport JS + React application internal 500 errro
I certainly can't say but in your code
//initialize passport
initpassport(
passport,
async username => await User.findOne({ username: username }),
async id => await User.findOne({ ...
0
votes
Warning: Only plain objects can be passed to Client Components from Server Components
This worked for me:
The Query.prototype.lean() function returns the documents from queries with the lean option enabled as plain JavaScript objects, not Mongoose Documents read more about .lean().
And ...
0
votes
Error in the integration between Hardhat and react.js
you might have installed ethers v6 but using ethers v5 implementation. From migrating guide
// v5
provider = new ethers.providers.Web3Provider(window.ethereum)
// v6:
provider = new ethers....
0
votes
Use reactjs to get login info from golang session
On Subsequent requests, you can add this after logging in:
// src/api.js
const api = axios.create({
baseURL: 'http://localhost:8080', // Your backend URL
withCredentials: true,
...
0
votes
React native DatePicker provide android error
I ran into this as well, and added a workaround to this github ticket, namely, wrap the <DatePickerBody /> in another <DatePickerProvider>:
export function DatePickerExample() {
const ...
-1
votes
Page Not Found in Netlify
You need to redirect all requests to index.html by creating _redirects file in the root directory of your react app and add the following into it:
/* /index.html 200
0
votes
Getting error when doing npx create-react-app my-react-app
If you would like to use react with JS, use the following boilerplate:
Webpack react boilerplate
If you would like to use react with typescript, use the following boilerplate:
Webpack react typescript ...
0
votes
Why doesn't webstorm/react-hook-forms tell me possible options for name?
You can achieve what you want in a simpler way, changing your StringInput component like this:
const StringInput = ({ name }: { name: keyof Data }) => {
const { control } = useFormContext<Data&...
0
votes
Webpack module federation directory share
The following will expose all components in the components directory:
exposes: {
'./components': path.join(PATHS.src, 'components'),
},
Here’s a very nice example where I have 3 projects interacting ...
Top 50 recent answers are included
Related Tags
reactjs × 483902javascript × 207463
react-native × 40299
react-hooks × 36567
typescript × 33663
redux × 27909
node.js × 27643
css × 25051
next.js × 22106
material-ui × 19573
react-router × 19280
react-redux × 19101
html × 18659
webpack × 11329
axios × 10934
jestjs × 9237
firebase × 9171
arrays × 8778
express × 8673
jsx × 8000
react-router-dom × 7483
npm × 6900
ecmascript-6 × 6779
json × 5843
state × 4685