I've copied the code for the Range Slider:
import React from 'react';
import Box from '@mui/material/Box';
import Slider from '@mui/material/Slider';
function valuetext(value) {
return `${value}°C`;
}
export default function RangeSlider() {
const [value, setValue] = React.useState([20, 37]);
const handleChange = (event, newValue) => {
setValue(newValue);
};
return (
<Box sx={{ width: 300 }}>
<Slider
getAriaLabel={() => 'Temperature range'}
value={value}
onChange={handleChange}
valueLabelDisplay="auto"
getAriaValueText={valuetext}
/>
</Box>
);
}
And I'm using it like this:
import axios from 'axios';
import React, {useState, useEffect } from 'react';
import '../components/Navbar'
import Navbar from '../components/Navbar';
import RangeSlider from '../components/RangeSlider';
export default function Slider() {
return (
<>
<Navbar />
<div>
<header>
<p> Edit and save to reload.</p>
<p> Edit and save to reload.</p>
<RangeSlider />
</header>
</div>
</>
);
}
However, when I use the component, my entire page goes blank. It is fine without this line. The only thing I've changed from the documentation is "import React from 'react'; ", but I've been getting the same issue even with the original line.
This is from the Chrome console: Error codes