Skip to content

Instantly share code, notes, and snippets.

Trần Văn Luận luandevpro

Block or report user

Report or block luandevpro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.js
import { useSelector, useDispatch } from 'react-redux';
import { Formik, Form } from 'formik';
import Axios from 'axios';
import FormWizard from '../components/FormWizard';
import { withRedux } from '../lib/withRedux';
import Email from '../components/Email';
import ValidateEmail from '../components/ValidateEmail';
import Final from '../components/Final';
import * as actions from '../actions';
View FormWizard.js
import React from 'react';
import PropTypes from 'prop-types';
export default function FormWizard({ children }) {
return <div>{children[0]}</div>;
}
FormWizard.propTypes = {
children: PropTypes.array, // eslint-disable-line
};
View result
0: {$$typeof: Symbol(react.element), key: null, ref: null, props: {…}, type: ƒ, …}
1: {$$typeof: Symbol(react.element), key: null, ref: null, props: {…}, type: ƒ, …}
2: {$$typeof: Symbol(react.element), key: null, ref: null, props: {…}, type: ƒ, …}
length: 3
__proto__: Array(0)
View FormWizard.js
import React from 'react';
import PropTypes from 'prop-types';
export default function FormWizard({ children }) {
console.log(children);
return <div>{children}</div>;
}
FormWizard.propTypes = {
children: PropTypes.array, // eslint-disable-line
View index.js
import FormWizard from '../components/FormWizard';
import { withRedux } from '../lib/withRedux';
import Email from '../components/Email';
import ValidateEmail from '../components/ValidateEmail';
import Final from '../components/Final';
function Index() {
return (
<div className="container mt-5">
<FormWizard>
View FormWizard.js
import React from 'react';
import PropTypes from 'prop-types';
export default function FormWizard({ children }) {
return <div>{children}</div>;
}
FormWizard.propTypes = {
children: PropTypes.array, // eslint-disable-line
};
View Final.js
import React from 'react';
export default function Final() {
return <div>bước 3 : final</div>;
}
View ValidateEmail.js
import React from 'react';
export default () => {
return <div>bước 2 : validate</div>;
};
View Email.js
import React from 'react';
export default function Email() {
return <div>bước 1 : get email</div>;
}
View index.js
import { combineReducers } from 'redux';
import useTest from './useTest';
const reducers = combineReducers({
test: useTest,
});
export default reducers;
You can’t perform that action at this time.