Skip to content

Conversation

@toger5
Copy link
Contributor

@toger5 toger5 commented Jul 4, 2022

For reviewers:

Copy link
Contributor Author

@toger5 toger5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments on things that I am not too confident:


useEffect(() => {
setState({ json: state });
setState(state);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was it done with the {json: ...} before? Should the useState be changed to:
useState({json: {}} as {json: State});

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, not sure - would have to ask @robertlong, although I'd probably just remove the json

@toger5 toger5 changed the title ts_conversion for src/room typescript src/room Jul 4, 2022
@toger5 toger5 marked this pull request as ready for review July 7, 2022 21:36
@toger5 toger5 requested a review from a team as a code owner July 7, 2022 21:36
Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good on a first pass! On adding deps, just yarn add & commit package.json & yarn.lock as normal.


useEffect(() => {
setState({ json: state });
setState(state);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, not sure - would have to ask @robertlong, although I'd probably just remove the json

@toger5 toger5 requested a review from dbkr July 14, 2022 19:54
Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels very nearly there - this will be most of the app done once its merged!

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [context, _] = useState<
[State, React.Dispatch<React.SetStateAction<State>>]
>([{}, () => {}]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you work out what was going on here? How does the context get set, and what's the weird value provided to the initialiser?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment where the context gets set. I also fixed the initial value.

@toger5 toger5 requested a review from dbkr July 27, 2022 21:47
Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for adding the comment.

@toger5 toger5 merged commit 2d99aca into element-hq:main Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants