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.

Controller not working for Material UI slider component

See original GitHub issue

Describe the bug Controller component not working for Material UI slider component. When value is changed on the controller, an error occurs:

" Received NaN for the children attribute. If this is expected, cast the value to a string."

To Reproduce Steps to reproduce the behavior:

  1. Go to [https://codesandbox.io/s/react-hook-form-controller-vj1o0]
  2. Set react hooks version to 6.0.3 or higher
  3. Scroll down to the slider
  4. Try to change the value of the slider
  5. See error in console

Codesandbox link (Required) https://codesandbox.io/s/react-hook-form-controller-vj1o0

make sure you change reat hook version

Expected behavior The value should change properly.

Desktop (please complete the following information):

  • Ubuntu 18.0.2
  • Chrome
  • Version 83

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
btorocommented, Jul 22, 2020

This CSB doesn’t have examples with Material UI, and isn’t very relevant… I’m trying to get this working with Material UI’s slider…

2reactions
btorocommented, Jul 22, 2020

You were correct, I saw the AntD example on first glace. My apologies to you @bluebill1049 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Material-UI Slider not drag when loading component from a ...
I think I am close and the values all get set as they should but the slider will not slide, you have to...
Read more >
React Slider component - Material UI - MUI
Sliders allow users to make selections from a range of values. ... The component handles most of the work necessary to make it...
Read more >
Using Material UI with React Hook Form - LogRocket Blog
As a result, when we try to use the Slider component inside a Controller component from React Hook Form, it throws error.
Read more >
React Hook Form Controller v7 Examples (MaterialUI, AntD ...
React Hook Form has a Controller component that allows you to use your third-party UI library components with its hook and custom register....
Read more >
Slider - Angular Material
UI component infrastructure and Material Design components for mobile and desktop Angular web applications.
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