Questions tagged [tcomb]

tcomb is a library for node.js and the browser which allows you to check the types of JavaScript values at runtime.

tcomb is a library for Node.js and the browser which allows you to check the types of JavaScript values at runtime with a simple and concise syntax. It's great for Domain Driven Design and for adding safety to your internal code.

23 questions
7
votes
1 answer

How do I add email validation to a field with tcomb-form-native?

Using the tcomb-form-native library with react native - I've set the keyboardType to email-address. How do I add a regex or email validator to the form? Do I have to do it on the submit function (and throw a special error?) or is there a regex…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
6
votes
3 answers

How to avoid reactjs to be included twice in a rails and reactjs environment?

I am using react-rails and browserify. In the application.js I use // require react // require react-ujs Also I use tcomb-form by using var t=require("tcomb-form") As the result I saw reactjs is included twice in my asset pipeline. How should I…
ziweizhou
  • 165
  • 7
4
votes
0 answers

Using tcomb-forms with React and Redux

So, I just spent 2, gulling, days getting a tcomb-form to work with my React component, keeping options, values and the type in Redux and building part of the form after an ajax call to an API get its data. It only now occurs to me to ask if anyone…
CpILL
  • 6,169
  • 5
  • 38
  • 37
3
votes
0 answers

react native t comb form error string ref "input" React.createRef()

I have the following form in my render function:
I create the ref in my constructor in the top: this.formRef = React.createRef(); Then I retrieve the value like…
user9408779
3
votes
1 answer

Disable a field based on another field's value

I am trying to implement a basic feature to disable a field based on another field's value. Here is the code sample: import React from 'react' import t from "tcomb-form-native"; import {Text, View, TextInput, TouchableHighlight } from…
BigD
  • 45
  • 5
3
votes
2 answers

adding selection menu to fields in react-native form

I want to input data to fields day and time using a dropdown selection menu .Please guide me how can I do that .I am new to react-native I have used the tcomb-form-native module from github. Please guide me through…
shrey mahajan
  • 31
  • 1
  • 4
2
votes
1 answer

React Native DatePicker Specific Hours

Is there a way in React native to choose specific hours in the date picker ? for example here in the DatePickerIOSe, we can choose mode: time. and there are two other Props (maximumDate, minimumDate) , is there a way to specify those to just hours…
Ahmad Yousef
  • 621
  • 9
  • 20
2
votes
0 answers

Javascript es6 re-exports

EDIT Maybe I found the problem, would like if someone could confirm the situation: It seems like test.js is importing index.js which is importing test.js, and export has not an stop infinite-loop inclusion... Is it right? Is there any workaround…
David
  • 2,741
  • 16
  • 26
1
vote
1 answer

Can I submit multiple tcomb forms with one onPress?

I'm building a React Native app and using the tomb-form-native library for my forms. In one of my screens, I loop through an array of types and output a form for each type: {my_types.map(ob => {ob.type}…
arnoldbird
  • 886
  • 1
  • 13
  • 30
1
vote
0 answers

React Tcomb form can't get the value of DateInput from factory

I have problem with tcomb-form. Inside my tcomb-form I declared an factory that have the an DateInput (@blueprintjs/datetime) Component. But when I get the values of the form. The that input field is undefined. Look like tcomb-form can't get the…
1
vote
1 answer

file preview and re-upload using gcanti/tcomb-form

I followed File upload example and this example I can now upload the file to s3. but when it comes to editing or replacing that file how should I handle that. const CustomFile = t.irreducible('File', x => x instanceof File); // MyModel const…
Raju
  • 109
  • 13
1
vote
1 answer

Accessing ref with the onFocus callback while using tcomb-form-native

I'm using https://github.com/gcanti/tcomb-form-native & here's the snippet of code _renderScene(route, navigator) { var Cook_time = { onFocus: () => { console.log('cook time has focus'); …
Sangeet Agarwal
  • 1,674
  • 16
  • 25
1
vote
1 answer

NPM installing nested dependency when already satisfied by parent

I'm having an issue with NPM installing two copies of React in my project. Here are the relevant parts of the dependencies: My package.json: "dependencies": { "react": "0.12.2", "tcomb-form": "0.4.5" } tcomb-form's…
Sean Adkinson
  • 8,425
  • 3
  • 45
  • 64
0
votes
2 answers

How to input button in tcomb react native

I want to put button in form for get current location and then put the value in coordinate I tried this but it doesnt work const validForm = t.struct({ coordinate: t.maybe(t.String), buttoncoordinate: t.maybe(t.String), }); let options = { …
Ray Coder
  • 1,022
  • 3
  • 15
  • 30
0
votes
1 answer

In the tcomb-form library, what date format will t.Date accept?

To set a value for a t.Date field, what format do I use? value.my_date = '2018-07-12T14:31:40' // This doesn't work. Neither does any other format I try. Note: I am not asking how to format a date for display. I need to populate my form fields…
arnoldbird
  • 886
  • 1
  • 13
  • 30
1
2