Questions tagged [reactjs]
React is a JavaScript library for building user interfaces. It uses a declarative, component-based paradigm and aims to be both efficient and flexible.
275,847
questions
0
votes
0answers
6 views
compilation error of .ts and .scss files in react project
I'm having the following erorr in my localhost when I run npm start for my react project:
./src/component7.scss (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-6-1!./node_modules/postcss-loader/...
-2
votes
0answers
12 views
Next.js functions
const files = fs.readdirSync("posts");
const slugs = files.map((filename) => filename.replace(".md", ""));
slugs.map((slug) => {
const contentWMeta = fs
...
3
votes
0answers
21 views
immer property change doesn't trigger update in functional component
I store a Node entity in state. When I click the button, I want to change the property 'title', and trigger component update to display the new title value.
Nothing happens in the function component, ...
0
votes
0answers
6 views
NextJS redirection to /error page leaves me in an unwanted render
Im not really sure how to describe this problem but ill do my best.
I have a nextJS project. With its server and SRC(site) folders.
One of the files that the site has is _error.jsx
import React from &...
0
votes
0answers
4 views
How to customize the border color, width, and height of Material-UI Text Field with styled-components
I'm getting a bit confused about how to customize Material-UI components. I've read through the docs and a team member said that they use styled-components.
I'm trying to change
the border color of a ...
0
votes
0answers
10 views
Yup + useFormik - conditional required field based on some parameter
I have a validation schema object:
SCHEMA = object().shape({
...
someField: string().required(validation_keys.required),
...
});
I am using useFormik within my component:
const formik = ...
0
votes
0answers
16 views
react port localhost//3001/login not found
I am trying to make a post request through axios but it is not working and console log error shows saying that react localhost//3000/login not found.
Here is my main login page:
import React, { ...
0
votes
0answers
15 views
Javascript / React- is there any js search / filter library that increases performance vs vanilla js? [closed]
is there any js search / filter library that increases performance vs vanilla js ? Ive been researching and found a few libraries but cant tell if there is any benefit performance wise over just ...
0
votes
0answers
6 views
Using local reference source image in react chakra ui
So I want to show an image and here's my code, I try using src="../styles/images/myImage.jpg" but my image doesn't show. This problem doesn't raise if I do this instead
import myImage from &...
-1
votes
1answer
12 views
How to add attribute selected to select React?
I have this code
{categories.map((category, index) => {
return(
<option value={category._id} key={index}>{category.name}</option>
)
})}
This code display all categories. And I ...
0
votes
1answer
26 views
Is there a way to automatically change a specific text color so it fits the background color?
Okay so let's say I have a group-chat and the owner is able to change the background color of the chat-bubbles. I have 10 different colors which I assign to the users on top of the chat-bubble so not ...
0
votes
1answer
13 views
ReactJS href attribute of collapse can't take props value
When I click the button inside of Collapse.js, the Card component must be shown. But it doesn't get 'props.href1' into href attribute. It gives this error:
Line 11:20: Parsing error: Unexpected token,...
2
votes
2answers
41 views
can I use variable declared within a function as a parameter for another function nested inside the function?
I am trying to create a function which basically look like this:
function parentFunction (){
const [a,setA]=useState(false);
function nestedFunction (a){
if (a===false){do ...
0
votes
1answer
21 views
Why is Current always null for React.createRef() in react typescript
below is my code and console shows that current is always null and I am not sure why.
private tree: any;
constructor(props) {
super(props);
this.tree = React.createRef()
this.state = {
/...
-1
votes
0answers
8 views
Gatsby.js MDXProvider returns string with functions instead of component
MDX provider returns functions as string instead of rendering a provided component.
What is rendered:
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < ...