Creating an account on React Native

Currently working on developing an Android App using React-Native and in need of implementing the SignUp Method.

For the database, I am utilizing PouchDB/CouchDB.

Sharing a snippet of my signup page code here:

Any ideas why it's not working as expected? Your insights are appreciated. Thank you.

Answer №1

Your method call does not align with the method signature provided.

// Method signature
static createUser(identity, FirstName, LastName, FiscalCode /*, Password*/)

// Incorrect Method call
User.createUser({identity: identity, FirstName: this.props.FirstName, LastName: this.props.LastName, FiscalCode: this.props.FiscalCode})

// Correct Method call
User.createUser(identity, this.props.FirstName, this.props.LastName, this.props.FiscalCode)

Furthermore, in the if condition, you are referencing class properties rather than state.

// Incorrect
            utility.isEmpty(this.Password) ||
            utility.isEmpty(this.PasswordRepeat)  

// Corrected
            utility.isEmpty(this.state.Password) ||
            utility.isEmpty(this.state.PasswordRepeat) 

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Expanding the functionality of Element.prototype, problem related to anchor

Consider the following code: A JavaScript (JS) Snippet Element.prototype.changeInnerText = function(str) { this.textContent = str; return this; } let divElement = document.createElement('div').changeInnerText('new div text'); / ...

How to set up and use custom variables in AngularJS plugins

Is there a way to incorporate webpack.config define plugin variables into AngularJS files such as controllers and services? Do I have to import webpack or a similar tool, and if so, how would I go about doing that? ...

How can I apply red border styling only after the first click in MUI React?

I am currently working with MUI Textfields and I have a specific styling requirement. I would like the field to display a red outline only after the first click, if the input is left blank or deleted. Essentially, I want the field to appear normal initiall ...

How can nested json be sorted effectively based on two specific fields?

Example Data: [{ 'ID': objID(abc123), 'Department': 'IT', 'Employees': [ { 'ID': 3, 'StartDate': '24-12-2022T08:30', 'active': true }, { ...

A guide to effortlessly converting Any[] to CustomType for seamless IntelliSense access to Properties within Angular/Typescript

Our Angular service interacts with the backend to retrieve data and display it on the UI. export interface UserDataResponse { id: number; userName: string; } AngularService_Method1() { return this.http.get<UserDataResponse[]>(this.appUrl + "/Ap ...

Mongoose Filtering in Rest API: A Comprehensive Guide

Currently, I am utilizing Express to construct an API. Within this API, my objective is to retrieve a list of customers from MongoDB by using Mongoose. The code snippet below showcases the route I have set up (please disregard any paging and limit concerns ...

Retrieve information from two separate MongoDB collections using the MongoJS library

My approach involves using MongoJS to retrieve data from a MongoDB database as shown in the code snippet below: var db = mongojs('db', ['events']); Subsequently, I have the following setup: app.get('/', function(req, res ...

What's the importance of including (req, res, next) in the bodyParser function within Express?

My original use of bodyParser looked like this: app.use(bodyParser.json()); However, I now have a need to conditionally use bodyParser: app.use((req, res, next) => { if (req.originalUrl === '/hooks') { next(); } else { ...

Automatic updates are enabled for Google Chrome extensions

I noticed that all the extensions I analyzed had a specific code in their manifest.json, even though Google says you don't have to include it if you host your Chrome app on their servers. Should I also include this code in my Chrome extension manifest ...

Convert your Airbnb short link into the full link

I am currently developing an application that utilizes Airbnb links as part of its input. So far, I have identified two types of links: Long form, for example: . These are commonly used on desktop. Short form, such as: . These shorter links are often shar ...

Utilizing the Value of an Array as a Key in a Different Array

Can someone help me with reading data from two arrays? The first array looks like this: tnails: [ { mil: '/static/mini/t-icon-mil.png', mar: '/static/mini/t-icon-mar.png', brd: '/static/mini/t-icon-brd.png&ap ...

Shift a Div to the left prior to stretching it out

I am trying to achieve a smooth leftward movement and expansion animation for a div. Currently, I am experimenting with class switching on click events to transition between the desired states. However, I am facing difficulty in making the element first mo ...

Is it possible to transform a class file into a function using hooks?

I have this React class that I want to convert into React hooks. I attempted to do so but ran into some issues. Here are the original and updated codes: class Parent extends React.Component { constructor(props) { super(props); this.state = { nam ...

Error message when trying to access a property that is not defined in objects returned

I am currently utilizing DWR for AJAX implementation. The method created by the creator is public ArrayList<CompanyRecord> step4QueryTable() throws JCoException {...} The structure of CompanyRecord class is as follows: public class Company ...

Vue fails to reflect changes in data when it is updated

I have a page where I can access data by calling domain.com/subpage?soundfile=something Using the fetch method, I extract the query parameter from the URL to retrieve the necessary information. The retrieval process is successful as indicated by the data ...

The Browserify/Stringify tool removes the Knockout Comment Binding functionality

As I work with Knockout and Browserify using Stringify, I am running into the issue of comments being stripped out by Stringify. These comments are important for my Knockout bindings to create a custom header within an iteration in a component. Is there a ...

Nodemailer is functioning properly in a local environment, however, it is encountering issues when

I am facing an issue with Nodemailer where it is sending emails successfully on my local machine but not on Lambda. I have tried various solutions from Stack Overflow, but none of them seem to be working for me. One suggestion was to make the sendEmail fun ...

Unable to retrieve the HTML value attribute that contains a double quotation mark

Here is an example of my HTML attribute: <span> <input class="editWidgetName" type="text" maxlength="100" value="Untitled "NAME" 30\10\2017" style="display:none;padding-right:1px;" /> </span> Despi ...

Save the JSON response to an object in order to easily access and retrieve the values from it

I am working on integrating the geonames' API to retrieve JSON data. I have created a dataStorage Object to store the response, but I am facing an issue when trying to access the stored value. Below is the code snippet: var dataStorage = new Object( ...

Struggling with paginating search results utilizing the useState hook, Material-UI, and a custom hook

Encountering a problem with pagination on a React application page where search results are displayed based on user input in the search bar. The issue seems to be related to how pagination is implemented on this specific page. The pagination functions cor ...