question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Zoom] Not accepting child component

See original GitHub issue

First of all, Thanks for giving this beautiful framework. It has always been a great experience to work with Material-UI.

Today, I updated my project to @material-ui/core@next. Successfully removed all deprecated props. But, failed to solve this issue. Prior to v4 this was working.

  • [ x ] This is not a v0.x issue.
  • [ x ] I have searched the issues of this repository and believe that this is not a duplicate.
// Input Field component
const InputField = ({
    field,
    form: { touched, errors },
    ...props
}) => {
    const error = errors[field.name];
    return (
        <TextField
            variant="outlined"
            margin="dense"
            error={touched && error ? true : false}
            helperText={touched && error ? `- ${error}` : null}
            fullWidth
            {...field}
            {...props}
        />
    );
};

Expected Behavior 🤔

Zoom component is not accepting a <Field/> component from Formik as child.

import { Field } from 'formik';

<Zoom in={show}>
         <Field
                 name="title"
                 type="text"
                 variant="outlined"
                 margin="dense"
                 component={InputField}
          />
</Zoom>

Current Behavior 😯

Zoom should be given a <div/> to wrap the <Field/> component

import { Field } from 'formik';

<Zoom in={show}>
           <div>
                  <Field
                            name="title"
                            type="text"
                            variant="outlined"
                            margin="dense"
                            component={InputField}
                   />
           </div>
</Zoom>

Error

I am getting this error in the console.

Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

Check the render method of `Transition`.

Context 🔦

I am trying to animate fields/buttons in form whenever the form appears in the DOM.

Your Environment 🌎

Tech Version
Material-UI ^4.0.0-beta.0
React ^16.8.6
Browser Chromium: 74.0.3729.108

Fun Fact: This is my first contribution 😋

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
eps1loncommented, Apr 30, 2019

@vkasraj #15526 should actually fix this.

1reaction
oliviertassinaricommented, Apr 29, 2019

It seems we won’t fix this here: #15519. I believe Formik should forward the ref. I have shared a workaround: https://github.com/jaredpalmer/formik/pull/478#issuecomment-487742488.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Zoom] Not accepting child component · Issue #15515 - GitHub
Today, I updated my project to @material-ui/core@next . Successfully removed all deprecated props. But, failed to solve this issue. Prior to v4 ...
Read more >
Managing Zoom Mesh parents and children - Zoom Support
Click the Devices tab. Devices that have been assigned as a parent or child during a webinar or event will be displayed. Note:...
Read more >
React Passing a function as prop to child component, but the ...
the zoom is not updated into 13 i want the zoom variable to be changend in the parent component when passing the function...
Read more >
Pass Multiple Children to a React Component with Slots
This component needs to be able to accept multiple children and place them in the layout as it sees fit – not right...
Read more >
Coping With COVID Part 2: Back To School Stress
Children's Hospital Colorado / PIP FREE Zoom Event | Coping With COVID Part ... This event is FREE on Zoom and NO previous...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found