You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the useSessionStorage hook and initialising the value to an empty string, React yields the folowwing error:
Warning: A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components
The hook seems to save the empty string as undefined instead of a literal ''.
Reproducer
No response
PrimeReact version
9.2.1
React version
18.x
Language
TypeScript
Build / Runtime
Next.js
Browser(s)
No response
Steps to reproduce the behavior
Create a variable using useSessionStorage initialised to '':
melloware
changed the title
Component: useSessionStorage hook
useSessionStorage Hook: initialization issue
May 8, 2023
melloware
added
Type: Bug
Issue contains a defect related to a specific component.
and removed
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
labels
May 8, 2023
Describe the bug
When using the
useSessionStorage
hook and initialising the value to an empty string, React yields the folowwing error:The hook seems to save the empty string as
undefined
instead of a literal''
.Reproducer
No response
PrimeReact version
9.2.1
React version
18.x
Language
TypeScript
Build / Runtime
Next.js
Browser(s)
No response
Steps to reproduce the behavior
useSessionStorage
initialised to''
:InputText
element:Expected behavior
No error.
The text was updated successfully, but these errors were encountered: