This is a solution to the Intro component with sign up form challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for the site depending on their device's screen size
- See hover states for all interactive elements on the page
- Receive an error message when the
formis submitted if:- Any
inputfield is empty. The message for this error should say "[Field Name] cannot be empty" - The email address is not formatted correctly (i.e. a correct email address should have this structure:
name@host.tld). The message for this error should say "Looks like this is not an email"
- Any
-Mobile
-Desktop
Then crop/optimize/edit your image however you like, add it to your project, and update the file path in the image above.
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- React - JS library
While building this little practice, I noticed a bug that react had when using google translate.
When google translate replaces the app's HTML tags with its translated tags, react doesn't find the references in the DOM for the tags it had created, thus causing the app to crash.
How do I solve it? Adding this little script to the top of my react app:
<script>
if (typeof Node === 'function' && Node.prototype) {
const originalRemoveChild = Node.prototype.removeChild;
Node.prototype.removeChild = function (child) {
if (child.parentNode !== this) {
if (console) {
console.error('Cannot remove a child from a different parent', child, this);
}
return child;
}
return originalRemoveChild.apply(this, arguments);
}
const originalInsertBefore = Node.prototype.insertBefore;
Node.prototype.insertBefore = function (newNode, referenceNode) {
if (referenceNode && referenceNode.parentNode !== this) {
if (console) {
console.error('Cannot insert before a reference node from a different parent', referenceNode, this);
}
return newNode;
}
return originalInsertBefore.apply(this, arguments);
}
}
</script>Here is the link where I found the solution:
- Frontend Mentor - @Rtf747

