Questions tagged [jsx]

JSX is an open source programming language, or an AltJS with classes and static types. The source code is compiled into JavaScript which is highly optimized.

Filter by
Sorted by
Tagged with
-1
votes
1answer
30 views

Reducing if conditional statement

Hello I'm trying to figure out the best way to reduce this if statement I was thinking of possibly chaining together ternary operator ...
0
votes
0answers
14 views

nested drop down for blog posts

I wrote this component to be a drop down for blog posts. The index prop is a PostIndex object returned from a query in the ...
1
vote
1answer
28 views

React component with axios calls

...
1
vote
1answer
29 views

ReactJS link with conditional CSS classes

I'm starting to learn React/NextJS and find the way to write conditional CSS very ugly compared to VueJS. I'm curious if someone could look over this code snippet and guide me in the right direction ...
4
votes
0answers
35 views

React - Show more and search functionality

I created a rough implementation of a component that lists stuff based on data has the option to enable searching for that data. I've not used React all that much so it's probably a terrible way to ...
2
votes
0answers
17 views

File Picker Component - React

Created FilePickerComponent recently. I'm new to React/Web development. Could you please help reviewing this code - ...
2
votes
0answers
31 views

Create a map where countries can be selected using react-leaflet

I've only just started learning javascript and decided to try and make a simple app where individual countries can be selected, highlighting them, and the name appearing in the top corner. The code ...
2
votes
1answer
30 views

Show react component given a condition

I want to show the battery icon given the status provided in props. I am trying to keep it simple but without writing too much code, i.e.: . ...
3
votes
1answer
50 views

Simple registration form with validation

I am really new to React and I worked on some challenges. I need to mention I did most of the stuff on my own without much dependence on the internet beside what functions do. I'd like to know if I ...
2
votes
1answer
37 views

React component to render price change

I've written this Card component which is composed of thumbnail image, name, symbol, ...
0
votes
1answer
95 views

This code renders a time dilation calculator

I've been learning React for about a month now. I wrote a small interactive calculator to show the effects of time dilation under special relativity. It's Node/React/Razzle(for SSR)/Typescript/...
1
vote
1answer
34 views

Created a basic User Profile List using an API (React)

I'm relatively new when it comes to programming in React and in JavaScript, but have a surface level understanding of what things do. I've created a basic program that fetches user data from an API ...
1
vote
1answer
31 views

Dynamic social media component w/ dark mode

Note: This is my first post for a code review, so any feedback on what other info would be helpful to post (if any) would be much appreciated! React component: Social.js The component has an input of ...
0
votes
1answer
31 views

Merge into an object from two different API calls

I'm working on an app to compare SDKS (their churn and acquisiton rates). I have created an API with two separate endpoints. The first, compares one sdk to ther other and spits out that data for each ...
2
votes
2answers
30 views

Display element in a grid and conditionally add to redux or remove if not selected

I have some logic on my JSX for an element in a grid, if element is selected, then add to redux, if element is not selected then remove from redux... is working ok, but I sense a bad smell... ...
1
vote
1answer
39 views

react component optimization

Dears I have following component ...
3
votes
1answer
78 views

How can I re-write the conditionals for this button

I've been trying out React for a couple of days and I tried to build a button component with some conditionals. Everything works but I feel like I am not doing it the right way. Could anyone review my ...
2
votes
0answers
68 views

naming convention for atomic design

please let me know if this question doesn't meet community standard for code review (I will delete it) Hey, I am probably terrible in naming files, functions etc. We follow atomic design principle. ...
3
votes
0answers
43 views

React Higher Order Components - export wrapped component or wrap it in parent?

I've been learning about about how to use context, and how to make a higher order component to provide context values through props. So, I've created my HOC to pass down the props, and it looks like ...
6
votes
1answer
152 views

Hacking Minigame

I made the UI for the hacking minigame from the Fallout series. Could I get some feedback on the main Game.js component? It's my first React app. I'm especially ...
3
votes
3answers
90 views

JSX render method in react

Following is the piece of code which is working fine, but somehow it looks bit odd to me to have a function inside a render method and using it in both conditions. Let me know how can I improve this ...
2
votes
2answers
30 views

Profile with static and input modes (View and Update)

I'm a solo developer and a friend told me that my code is not very readable. I always write code trying to keep it DRY while not taking longer than it would take doing it in an "easier" way. ...
4
votes
1answer
34 views

React avoid code repetation

I was working on a react hooks project. I was making a form In the form, I noticed myself writing a very wet code Here is my code ...
3
votes
1answer
57 views

React/Redux/Node/Express crud application with a React class component

https://try.gitea.io/nadal/repository Used this in a coding challenge after a job interview. I didn't get chosen, but I was wondering if it was because of the code quality in the project. ...
1
vote
0answers
32 views

Multi Selection Component (React + Hooks)

all. This component is meant to take in an array of available options and provide the user an easy way to choose multiple options. Each time the selected options are changed/updated, those options are ...
3
votes
2answers
123 views

How many `useState` and `useEffect` instances is conventional: one per page or one per app?

When you use React I think that each page uses the useState and useEffect hooks: Initiate a GET of data from the server, and ...
4
votes
1answer
404 views

9X9 Tic Tac Toe variant with frontend in react and backend in python flask_socketio

I (a junior back-end Java dev) decided I wanted to learn some front-end development skills; in particular, I wanted experience with React and websockets. I decided to write an app that would allow for ...
2
votes
1answer
1k views

React form actions > Edit, Save, Remove, Cancel

For my robot hobby project I need to expose the system's configuration so I can quickly make changes to it. So I have made a very simple app that generates a form. In this form you can edit, save ...
4
votes
3answers
188 views

batch progress visualization In React.js

I am slowly digesting React.js, found couple of ways to write the same piece of code: Please tell where all I went wrong in below code. I try to put logic inside ...
2
votes
0answers
793 views

Method to hide/show table columns with React/JSX

I am writing a function inside of a React component to hide/show columns in a table. The table is generated from an imported config object containing objects which model the column data. We render by ...
3
votes
1answer
981 views

React setState function in useEffect

I'm toggling a state when the browser is resized: ...
3
votes
0answers
33 views

Prettified GridView: is this JS code concise?

I been writing code for my company for years and there is never any constructive criticism for what I do. I am the only developer here and I would appreciate your opinion on this web page I made. It ...
3
votes
0answers
29 views

React.js component to lazy-load image

I'm trying to design a better solution for img srcset with lazy load. Below is the code from the component responsible for lazy load img, maybe someone has a better way to achieve this effect. Full ...
1
vote
2answers
60 views

Check which state is activated and render the JSX accordingly

Just wondering how I can go about doing this more efficiently/make it more visually appealing to the user? ...
1
vote
0answers
28 views

Beginner React App - handling different components with the same variable

I've made a simple app that shows if the term entered into the search bar is present in a number of common English words. This is the stackblitz: https://stackblitz.com/edit/react-mostusedwords Note ...
1
vote
0answers
202 views

React Native form for entering one-time password [closed]

Here is the React Native code to optimize: it's an OTP form. I want it to be as small as possible. ...
5
votes
2answers
344 views

Calculator app in React

This is a simple calculator app that involves entering two numbers and allowing them to be editable and swappable. Calculations are done on the numbers, so the calculations should only be done when ...
4
votes
1answer
235 views

Reddit style comment chains in React

This isn't meant to be a fully-featured anything, isn't meant to involve any sort of api interactions. It's just meant to be a proof-of-concept of how I could implement nested reddit-style comments. ...
2
votes
1answer
46 views

Highlight strings that match a search term

I'm writing a ctrl+f function so to speak in React that allows a user to search for a term in a list of words, and if the term matches any of the words in the list then it highlights it. To do this, I'...
1
vote
1answer
59 views

Implementing a Treeview component using React

Today after watching a getting started course about React, I tried to code my very first React component, a "treeview" as the title says. It does work, but as a newbie I know there are many ...
4
votes
0answers
83 views

React - pomodoro clock

I'm looking for some feedback on a pomodoro clock that I recently wrote with React. I'm pretty new to React and coding in general. I followed a couple of online courses, but I'm mostly self-taught. ...
0
votes
0answers
29 views

Using multiple dropdowns that have a single source of options

This code works as is but I'd like to learn if there's any way it could be simplified or cleaner looking. There are 3 dropdowns. Each dropdown's list of options are based on a single array of options....
3
votes
1answer
52 views

Code for printing list in React

Below is an implementation of a React app printing list. Are there any areas of improvement/suggestions in below code base ...
4
votes
2answers
358 views

React.js calculator

I have a calculator (in React) and I wonder if the way I did is is good or what I could improve. I wanted to do it like the iphone calculator (you dont only see results when you press =) and I feel ...
2
votes
1answer
82 views

ReactJS Calling an API and rendering results

I am currently learning JS Frameworks, right now exploring React and wanted to make sure I keep everything in order, as in: the logic of working with React, code quality, any shortcomings, good/bad ...
1
vote
0answers
162 views

Allows the use of Redux to manage the state of a grid with the Kendo React Library

I wanted to use Redux to manage the state of my KendoUI components such as the grid. The online examples from Telerik do not seem to contain clear information on how to do this, so, I started to ...
1
vote
1answer
46 views

React - Bottleneck Textinput / Filtering

I've got a big react app (with Redux) here that has a huge bottleneck. We have implemented a product search by using product number or product name and this search is extremely laggy. Problem: If ...
1
vote
0answers
17 views

React tabbed template

I made this simple tabbed app template and one thing in particular I am not sure about is my creation of a pageMap object. The thinking behind it is that you can ...
1
vote
0answers
23 views

Propagating data in React

I'm learning React recently, but I've been having some issues regarding propagating data from component to component. My general situation is: I have a textarea ...
3
votes
1answer
11k views

TypeScript implicit 'any' type with computed property key

(irrelevant code removed for demo purposes) I am new to using TypeScript and I have this React component which has an object literal inside the component, which I'm then accessing using a computed ...