|
|
bcba6db522
|
Initial
Example usage
import React from 'react';
import ReactDOM from 'react-dom';
import LCPFormRepeater from './LCPFormRepeater';
const App = () => {
// Define the fields structure in JSON format
const fields = [
{ type: 'text', label: 'Name', placeholder: 'Enter your name' },
{ type: 'email', label: 'Email', placeholder: 'Enter your email' },
{ type: 'number', label: 'Age', placeholder: 'Enter your age' },
{ type: 'textarea', label: 'Message', placeholder: 'Enter your message' },
];
// Define the submit callback
const handleFormSubmit = (formData) => {
console.log('Form submitted with data:', formData);
};
return (
<div>
<h1>LCP Form Repeater Example</h1>
<LCPFormRepeater fields={fields} onSubmit={handleFormSubmit} />
</div>
);
};
ReactDOM.render(<App />, document.getElementById('root'));
|
2025-01-08 23:27:03 +00:00 |
|