Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function renderTextField(props) { }
- function renderSelectField(props) { }
- const fieldMapping = {
- text: renderTextField,
- select: renderSelectField,
- };
- function renderField(field) {
- const renderFn = fieldMapping[field.type];
- renderFn(field.data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement