Build a Color Picker App - Build a Color Picker App

Tell us what’s happening:

please help i cant get the last test but my app works well

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <title>Color Picker</title>
    <link rel="stylesheet" href="styles.css" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/react/18.3.1/umd/react.development.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.3.1/umd/react-dom.development.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/7.26.5/babel.min.js"></script>
    <script
      data-plugins="transform-modules-umd"
      type="text/babel"
      src="index.jsx"
    ></script>
</head>

<body>
    <div id="root"></div>
    <script
      data-plugins="transform-modules-umd"
      type="text/babel"
      data-presets="react"
      data-type="module"
    >
      import { ColorPicker } from './index.jsx';
      ReactDOM.createRoot(document.getElementById('root')).render(<ColorPicker />);
    </script>
</body>

</html>
/* file: styles.css */
body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
}

#color-picker-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background-color: #ffffff;
}

input[type="color"] {
    position: absolute;
    margin-top: 50px;
    height: 40px;
}
p{
    position:absolute;
    top:0;
}
/* file: index.jsx */
const { useState } = React;

export const ColorPicker = () => {
const [color,setColor]=useState('#ffffff')

function colorChange(e){
  setColor(e.target.value)
}
  return (
    <>
   {color &&<div id="color-picker-container" style={{backgroundColor: color,
    padding: '20px',
     borderRadius: '8px',
    transition: 'background-color 0.3s ease',
}}>
    <input id="color-input" type='color' onChange={colorChange} value={color} />
    <p style={{ color: '#333' }}>Selected color: {color}</p>
    </div>}
    </>
  )
};

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36

Challenge Information:

Build a Color Picker App - Build a Color Picker App
https://www.freecodecamp.org/learn/full-stack-developer/lab-color-picker/build-a-color-picker-app

What is the last test?

What lines of code do you believe satisfies that test?

What debugging have you done so far?

test 14 fails:When your #color-input value is changed, your #color-picker-container should change its background color to reflect that value.

style={{backgroundColor: color,

const { useState } = React;

export const ColorPicker = () => {
const [color,setColor]=useState('#ffffff')

function colorChange(e){
  setColor(e.target.value)

}
  return (
  <div id="color-picker-container" style={{backgroundColor: color,
    padding: '20px',
     borderRadius: '8px',
    transition: 'background-color 0.5s ease',
}}>
    <input id="color-input" type='color' onChange={colorChange} value={color} />
    <h1 style={{ color: '#333' }}>Selected color: {color}</h1>
    </div>
  )
};

new code

i removed :

padding: '20px',
     borderRadius: '8px',
    transition: 'background-color 0.5s ease',

from the style and it passed

oh, yeah, transition makes the change happen after the tests check things