Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix v0.19.0 deploy bugs #275

Merged
merged 3 commits into from
Jul 16, 2024
Merged

fix v0.19.0 deploy bugs #275

merged 3 commits into from
Jul 16, 2024

Conversation

pedroferreira1
Copy link
Member

Description

  1. TypeError: axios.create is not a function

It's still unclear why this stopped working in this release but using import instead of require fixes the bug. 8cabe6f

  1. hooks can only be called inside of the body of a function component.

The method useFlag can't be used inside of class component. 34f4e6f

Acceptance Criteria

  • Use import instead of require for axios.
  • Refactor Navigation component to a function.

Security Checklist

  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@pedroferreira1 pedroferreira1 requested a review from tuliomir July 15, 2024 22:31
@pedroferreira1 pedroferreira1 requested a review from r4mmer as a code owner July 15, 2024 22:31
@pedroferreira1 pedroferreira1 self-assigned this Jul 15, 2024
r4mmer
r4mmer previously approved these changes Jul 15, 2024
tuliomir
tuliomir previously approved these changes Jul 15, 2024
class Navigation extends React.Component {
constructor(props) {
super(props);
function Navigation(props) {
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion(non-blocking): I'd suggest making each of the props explicit, to make it clear what must be passed to this component.

Suggested change
function Navigation(props) {
function Navigation({ history }) {

In this specific case, making history explicit will allow us easily modify it to use the following syntax as soon as we upgrade react-router-dom to v5.x:

import { useHistory } from "react-router-dom";

function Navigation() {
  const history = useHistory();
  ...
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Done 05763f6

@pedroferreira1 pedroferreira1 dismissed stale reviews from tuliomir and r4mmer via 05763f6 July 16, 2024 02:50
@pedroferreira1 pedroferreira1 merged commit 0a504e9 into dev Jul 16, 2024
1 check passed
@pedroferreira1 pedroferreira1 deleted the fix/v0.19.0-deploy-bugs branch July 16, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants