radio buttons in react, ignore null value

so i'm developing a personality quiz app using one of the tutorials i found on the internet //, I have a quizQuestions.js file for api where i fetch the answer and the question from, like so { question: "I am task oriented ...
more »

2017-10-04 05:10 (1) Answers

Why can't I read the property value in event

I am trying to access the value of the material ui text input i am using when i call the function but i also need to pass through other parameters, this is the code that calls the function in its parent class. <Input value={this.props.appSt...
more »

2017-09-29 11:09 (2) Answers

react onClick JSX returned from function

I'm using the array map method below to iterate over an array of image urls, and return some JSX with the img src. Ideally, I'd like to bind click to each image so that I can get this (clicked) img src into redux later. The below, gives me an error...
more »

2017-09-28 16:09 (3) Answers

osx create-react-app not installing

I am trying to install react using the terminal command: npm install -g create-react-app But it doesn't seem to be working and I get the following output: create-react-app output Does anyone know what might be the problem here? ...
more »

2017-09-21 13:09 (1) Answers

Correct way to inline style in JSX

I am trying to do inline style for which following is working <dt className='some-element' style={{backgroundColor : '#1a1a1a', fill: '#1a1a1a'}}> Now I am trying to change the hex value every time so trying to have something like let styl...
more »

2017-09-20 23:09 (1) Answers

Retrieve clicked array item on React Component

I have a Search component that outputs values from an array to a ResultItem child component, every child component has a button with a onClick property on it. I bound a function to the button to get the value of an array item that I clicked. What I...
more »

2017-09-11 01:09 (2) Answers

React FabricJS Grouping (JSX)

NPM Package: I'm using react-fabricjs and have a canvas with some icons showing. I'm now trying to get Grouping to work but I can't work out the syntax. Essentially I want to create this effect but using...
more »

2017-09-06 02:09 (1) Answers

how to pass parameter in (translation) string

I am trying to pass param values to translation item.title is Healthy and heading is Patient Info translation file has translation under project/healthy_patient_info This is what i have so far {item.title.toLowerCase()} {heading.split(...
more »

2017-08-29 02:08 (1) Answers

Trouble Loading Method in React Component

React NOOB issue I'm having: I have a JSX file that uses Axios to make an API call: fetch-api-data.jsx: import * as axios from 'axios'; export class FetchApiData { constructor() { console.log('FetchAPIData loaded'); } shareM...
more »

2017-08-28 21:08 (2) Answers

Compilation Issue with a React Login Screen

I've been trying to compile the front end of this guide (git repository here) to get my head round JSX and React. I want to eventually use the code to produce a login screen for a Cordova app. When trying to compile with webpack, for which I have th...
more »

2017-08-19 19:08 (0) Answers

Why isn't JSX saved as a const rendering

I am fairly new to React & JSX however I was under the impression that you can save JSX as pretty much anything (var,const, let...). However when I save it as a const and try to render it like so: import React from 'react'; import ReactDOM from...
more »

2017-08-11 11:08 (4) Answers

Put a conditional statement in my JSX

<li className=`nav-item {(this.props.activteState===1) ? "active":""}`><a href="#">Main</a></li> ^ This is my code. I want the classname "active" to appear next to "nav-item" if the condition is met. I thought putting backti...
more »

2017-08-06 03:08 (1) Answers

Render an HTMLImageElement dom node in Preact

(Attention: I am asking about Preact, not React for which there are solutions using Reacts DomElement wrapper component). I have an HTMLImageElement, which is created using var img = document.createElement('img'). How can I render this manually crea...
more »

2017-08-05 20:08 (0) Answers

How to skip null while map? JSX

I'm new with ReactJs/Redux and JSX. I have a dynamical table with dynamic information in it. I have problem with map. I have 2 levels of map: <tbody> { => ( <tr key={`${row.type}`}> <td> ...
more »

2017-07-28 15:07 (3) Answers

Create an extensible architecture with React

My team is creating the administration panel of a CMS using React, Typescript, TSX and Webpack. Each page of the administration panel has been created as a React component, and each page contains many other child components (one for each section). ...
more »

2017-07-27 18:07 (0) Answers

Import a function from JS to JSX

I have a JS file containing this code: module.exports = function loadMyFun() { function activateSite($currentItem) { ... } ... } And I want to import it into a JSX file, I tried to do it like this but I doesn't work: import MyN...
more »

2017-07-25 09:07 (2) Answers

React slide in navigation on button click

I am starting to work with React and trying to get my head around it. I am currently trying to build a navigation component that slides in when a button is clicked (the button lives in another component). Here is my code so far, class Application...
more »

2017-07-24 13:07 (2) Answers

reloading of react component in a tab

I created a react component that is basically a table. I called using a function with some parameters f(X, idPlaceholder). So f behaves like: f(X, idPlaceholder) { .... ReactDom.render( <T ... /> , document.getElementById(idPla...
more »

2017-07-19 22:07 (0) Answers

React "this" is always null in functions

I have this class. In all functions, this equals null except render() in Idea class. I tried to repeat solution from React.js: onChange event for contentEditable class Idea extends React.Component { render() { return ( ...
more »

2017-07-18 09:07 (4) Answers

Calling a function in React

I'm a beginner in React, and I'm little confused about calling a function in React. I saw the following ways and i don't when to use and which one. handleAddTodo ={this.handleAddTodo} handleAddTodo ={this.handleAddTodo()} handleAddTodo ={handleAdd...
more »

2017-07-14 11:07 (6) Answers

Join JSX with JSX

I've got a situation where I have several labels, with separator arrows in between them - sort of like breadcrumbs. The last label has no arrow after it. This seems like a perfect situation for .join(), for example: [1,2,3,4].join('->'); // "1...
more »

2017-07-06 23:07 (1) Answers

img src attribute url in jsx

I am trying to display images from an array, but when I am passing the src value as an expression {} it is just returning in the form of the object instead of a string.can anyone explain? export default class Home extends Component{ constructor(...
more »

2017-06-29 03:06 (1) Answers