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 component state #635

Merged
merged 1 commit into from
Mar 27, 2023
Merged

Fix component state #635

merged 1 commit into from
Mar 27, 2023

Conversation

Fosol
Copy link
Collaborator

@Fosol Fosol commented Mar 27, 2023

The DatePicker and Toning components had state bugs which would not correctly display or update when loading new content.

  • Rename TopicForm
  • Publish tno-core:0.0.226

image

Rename TopicForm
Publish tno-core:0.0.226
@Fosol Fosol added the bug Something isn't working label Mar 27, 2023
@Fosol Fosol requested a review from jdtoombs as a code owner March 27, 2023 17:12
@Fosol Fosol self-assigned this Mar 27, 2023
@@ -197,7 +197,7 @@ export const ContentStoryForm: React.FC<IContentStoryFormProps> = ({
>
<Row>
<div className="vl" />
<TopicForm />
<Topic />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Renamed

const value = values.tonePools?.length ? values.tonePools[0].value : undefined;

const [active, setActive] = React.useState(value);

React.useEffect(() => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jdtoombs The state would not get updated when we load a new story.

selectedDate ? new Date(selectedDate) : undefined,
);

React.useEffect(() => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jdtoombs The state would not get updated when we load a new story.

@Fosol Fosol merged commit 14d8999 into bcgov:dev Mar 27, 2023
@Fosol Fosol deleted the tno-1177 branch March 27, 2023 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant