Skip to content

Tag: jsx

How Can I render Two-dimensions-Array in JSX (React Native)?

I am coding Two-dimensions-Array in ReactNative. Single-Array is successful in JSX. But I do not get how to use Two-dimensions-Array in JSX. Can we use Two-dimensions-Array in JSX ? Rendering is successful Rendering is nothing (my question) myDoubleArray is Two-dimensions-Array like this. Answer You do not return a value from the outer map function. So, the product of it is

react js : children style doesn’t show

I tried to create a component ‘Card’ and use it like a container. the code work well without ‘card’. when I tried to add it the ‘Card.css’ and expense-item in ExpenseItem.css doesn’t work this is ‘ExpenseItem.js’: this is ‘Card.js’: and this is ‘Card.css’: and finally this is ‘ExpenseItem.css’: Answer You need a space between card and the class name in

How to solve undefined is not a function (near ‘……’)?

Im trying to render some strings , but I’m getting error, someone knows how to solve it ? code : route.params.paramKey is a string route.params.paramKey string is = {“objeto”:”CLMobj_test”,”fields”:[“abcs”,”test”],”type”:[“Date”,”Text”]} Answer Since route.params.paramKey is a string, you cannot call map on it directly. If you want to go ahead with this approach you can do something like this: EDIT: After you

Migrating from Babel to SWC with React

TL;DR How to translate a node script like this: to use SWC instead of Babel? Context We recently upgraded our Next.js version. Next.js now supports SWC instead of Babel. The unit tests for React in our project are written with RITEway. The test command is: It transforms the files with Babel first because otherwise import statements and JSX would cause

Push data inside an array index. React Native JSX

I am trying to compare, find and push data inside an array. But getting following error Error => TypeError: undefined is not an object (evaluating ‘data[index].push’) I have following JSON/Array I want to push packages object inside matching category so json/array will be as follows Following is the code what I was trying to do: Answer I don’t know how