Questions tagged [reactjs]
React is a JavaScript library for building user interfaces. It uses a declarative, component-based paradigm and aims to be efficient and flexible.
reactjs
479,755
questions
0
votes
1
answer
17
views
Why does React's tic-tac-toe show the winner?
Following along with the react tutorial to create a tic-tac-toe game, and it works, no problem there. I get why nearly all of it works, apart from the display of the winner.
import { useState } from '...
0
votes
0
answers
10
views
Simple sticky scroll effect causes glitch on mobile browsers
I wanted to use a scroll effect (parallax + filters) in a very simple page. It's just a sticky 120vh div with a background image and some text.
Everything works fine in the desktop browser and with ...
0
votes
0
answers
4
views
React DndKit, item gets added to the drop area even if just clicked. isOver is not activated only on the drop area
This is the main page. I have a list of draggable items that I display in a list.
Whenever I click any of those, without moving it, it gets added to the drop area.
event.over is activated everytime i ...
0
votes
0
answers
5
views
Context Load before Client? react-native
i created a context to start up the socket
but before that it validate the token sending a request to the server.
there is an issue that i can't really figure it out.
if the app is closed and i open ...
0
votes
0
answers
7
views
React & Cypress Component Tests: How to pass an object to an imported library in the Cypress setup?
I'm setting up Cypress to run component tests on a React-based app. The app uses multiple libraries, which I cannot change in any way. Although the app runs perfectly well, I'm unable to get any ...
0
votes
1
answer
10
views
Uneven spacing between flex items when using flexbox
NavBar.js
import React from "react";
import ReactDOM from 'react-dom';
import ReactDOMServer from 'react-dom/server';
import './NavBar.css';
function NavBar() {
const heading = 'first ...
0
votes
0
answers
13
views
Generate object access keys from props
I have problems with dynamisation in Typescript. I know that TS works statically. However, there are sometimes situations where I want to access an object dynamically and cannot do this directly via ...
0
votes
0
answers
16
views
tsParticles particles not showing
I'm trying to do a polygon mask on an svg with tsParticles.
However neither the particles or the svg show up, only the background color I define in my CSS.
Here is my particles component:
import { ...
0
votes
0
answers
11
views
sticky worked fine but after adding menu navbar it broke right now not working
I was using the CSS position: sticky on my sidebar so it moved down as the user scrolled. However when I added the mobile menu which transitioned in from the right, the sticky sidebar broke. Could not ...
0
votes
0
answers
12
views
Mock static method of object in react jest
I want to mock a static method defined outside a component.
Here is my component:
import Authenticate from '/api/Authenticate';
export default class MyComponent extends React.Component {
render() {
...
0
votes
0
answers
6
views
babel-plugin-styled-components works well with NODE_ENV=development but not with NODE_ENV=production in React app
I am facing the following situation in my React App. I use babel-plugin-styled-components. When NODE_ENV!==production classes are generated and injected in the head tag and used by the React ...
0
votes
0
answers
5
views
Mapbox: Text of the point/circle behind is visible over the point in front
I want to show the points and to write data inside. Problem is that the data (numbers) are shown for the points behind instead of the ones in front.
I would also like for smaller number circles to ...
-1
votes
0
answers
11
views
Having issues with a messenger clone
So everything was working fine until I decided to add a header component to my messenger clone.This specific problem has returned null and crashed my application like 5-6 times. Can anyone help why ...
-1
votes
0
answers
29
views
How to add a horizontal scroll onclick with a button or arrow?
I am trying to add a simple button to scroll horizontally, not using any libraries or anything just want to keep it simple. As of now I have the cards flowing horizontally in one row and there is the ...
-2
votes
0
answers
10
views
Hello everyone, I want to create and publish my own React packages. needed your guidance.thanks
I am interested in creating and publishing my own React packages and would greatly appreciate any guidance or information you can provide. Here are some specific aspects where I need help:
...