xxxxxxxxxx
$('#datepicker').datepicker({
autoclose: true
});
xxxxxxxxxx
1. Add tsconfig.json file to project
2. Integrate with a build tool
3. Change all .js files to .ts files
4. Check for any errors
xxxxxxxxxx
const Validacao =() => {
const {getFieldProps, handleSubmit, isValid} = useFormik({
initialValues: {
name:'',
contact:{
email:'',
phone:''
}
},
validate: values => {
const err ={}
const message= ' campo obrigatorio'
if(!values.name) err.name = message
if(!values.contact.email) err.email = message
return err
},
onSubmit: (values, bag) => {
console.log(values)
}
})
const [name, metadataName] = getFieldProps('name','text')
const [email, metadataEmail] = getFieldProps('contact.email', 'text')
const [phone, metadataPhone] = getFieldProps('contact.phone', 'text')
xxxxxxxxxx
import React from 'react';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import FirstStep from '../components/FirstStep';
import Header from '../components/Header';
const AppRouter = () => (
<BrowserRouter>
<div className="container">
<Header />
<Switch>
<Route component={FirstStep} path="/" exact={true} />
</Switch>
</div>
</BrowserRouter>
);
export default AppRouter;
xxxxxxxxxx
$('.progress').each(function (_, progress) {
var steps = $('> div.right > div', progress);
steps.each(function (i, el) { return $(el).mouseenter(function (e) { return onHover(el); }); });
var onHover = function (el) {
steps.removeClass(['current', 'prev']);
el.classList.add('current');
$(el).prevAll().slice(1).addClass('prev');
};
});
xxxxxxxxxx
first.put("first.name", "Alan");
first.put("last.name", "Jones");
first.put("owner", true);
first.put("years.old", 30);
**JSONArray cars = new JSONArray();**
cars.add(0, "VW");
cars.add(1, "GM");
cars.add(2, "Lexus");
cars.add(3, true);
cars.add(4, 42);
cars.add(5, 2.71);
first.put("cars", cars);
finalJson.add(first);
xxxxxxxxxx
import React from "react";
import { useTable } from "react-table";
export default function BasicTable({ columns, data }) {
// Use the useTable Hook to send the columns and data to build the table
const {
getTableProps, // Sends the needed props to your table.
getTableBodyProps, // Sends needed props to your table body
headerGroups, // Returns normalized header groups
rows, // rows for the table based on the data passed
prepareRow // Prepare the row in order to be displayed.
} = useTable({
columns,
data
});
}
xxxxxxxxxx
import React, {Component} from 'react'
import {ColorPropType, Text} from 'react-native'
import { colors } from '../constants'
const UIText = (props) => <Text {props}
style={[{
fontFamily: 'PatrickHand-Regular',
color: colors.primary
}, props.style]}>{props.children}
</Text>
export default UIText
xxxxxxxxxx
(function ($) {
if($('.menu-trigger').length){
$(".menu-trigger").on('click', function() {
$(this).toggleClass('active');
$('.header-area .nav').slideToggle(200);
});
}
})(window.jQuery);