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.

Passed "React: Pass Props to a Stateless Functional Component" challenge with wrong solution

See original GitHub issue

Describe your problem and how to reproduce it: I passed the “React: Pass Props to a Stateless Functional Component” challenge with wrong solution as below, correct answer is commented beside:

const CurrentDate = (props) => {
  return (
    <div>
      { /* change code below this line */ }
      <p>The current date is: {Date()}</p>//<p>The current date is: {props.date}</p>
      { /* change code above this line */ }
    </div>
  );
};

class Calendar extends React.Component {
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <div>
        <h3>What date is it?</h3>
        { /* change code below this line */ }
        <CurrentDate date="date"/>//<CurrentDate date={Date()} />
        { /* change code above this line */ }
      </div>
    );
  }
};

Add a Link to the page with the problem: https://learn.freecodecamp.org/front-end-libraries/react/pass-props-to-a-stateless-functional-component

Tell us about your browser and operating system:

  • Browser Name: Google Chrome
  • Browser Version: Version 75.0.3770.100 (Official Build) (64-bit)
  • Operating System: Windows 10

This is my first time opening an issue, I followed “Creating a New Github Issue” guide on freeCodeCamp forum. Please let me know if I am doing it wrong or there is a better approach, thank you.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
RandellDawsoncommented, Sep 6, 2019

@Paul--- We are waiting for a PR to be reviewed/tested/merged and then master to be release to production before you will see the issue completely resolved.

0reactions
Dhruvrana8commented, Jul 23, 2021

The Solution is : image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pass Props to a Stateless Functional Component - JavaScript
Any one explain to me and give me a solution because i am pinned out from 2 hours. Regards, Ali Mosaad. My code...
Read more >
React Pass Props to a Stateless Functional Component
I'd like to get the value from notificationCount to AuthLinks component, but as is a value from a variable seems that should be...
Read more >
Pass Props to a Stateless Functional Component - React
In this React tutorial we -TITLE-. This video constitutes one part of many where I cover the FreeCodeCamp (www.freecodecamp.org) curriculum.
Read more >
Passing Props to a Component - React Docs
Recap · To pass props, add them to the JSX, just like you would with HTML attributes. · To read props, use the...
Read more >
React Interview Questions and Answers (2023) - InterviewBit
To pass data between such components, we pass props from a source component and keep passing the prop to the next component in...
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